Nguyen Huu Nhat created CONNECTORS-1728:
-------------------------------------------
Summary: Fix error message of Generic Repository Connector
Key: CONNECTORS-1728
URL: https://issues.apache.org/jira/browse/CONNECTORS-1728
Project: ManifoldCF
Issue Type: Bug
Reporter: Nguyen Huu Nhat
Hi there,
As there is a problem that is still not addressed during use, I would like to
suggest the following correction for the source code of the Generic Repository
Connector.
For additional details, please see below:
h3. +*1. Connector name*+
Generic Repository Connector
h3. +*2. Issue*+
In the *run()* method of the *GenericConnector$DocumentVersionThread* class, if
connector cannot connect to REST API (HTTP status code != 200), there is an
error message in log file:
[ *addSeedDocuments error* - interface returned incorrect return code for: ... ]
However, this is *DocumentVersionThread* thread, not *ExecuteSeedingThread*
thread. The *addSeedDocuments error* prefix is not suiable to this thread.
I think it should be *getDocumentVersions error* prefix.
h3. +*3. Cause*+
This may be a copy/paste mistake:
[https://github.com/apache/manifoldcf/blob/release-2.22.1/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java#L1207]
{code:java}
if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
exception = new ManifoldCFException("addSeedDocuments error -
interface returned incorrect return code for: " + url + " - " +
response.getStatusLine().toString());
return;
}
{code}
h3. +*4. Solution*+
Updating the content of this error message from [addSeedDocuments error] to
[getDocumentVersions error]
h3. +*5. Suggested source code (based on release 2.22.1)*+
[https://github.com/apache/manifoldcf/blob/release-2.22.1/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java#L1207]
{code:java}
if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
- exception = new ManifoldCFException("addSeedDocuments error -
interface returned incorrect return code for: " + url + " - " +
response.getStatusLine().toString());
+ exception = new ManifoldCFException("getDocumentVersions error -
interface returned incorrect return code for: " + url + " - " +
response.getStatusLine().toString());
return;
}
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)