Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
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:
1. Connector name
Generic Repository Connector
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.
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
if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { exception = new ManifoldCFException("addSeedDocuments error - interface returned incorrect return code for: " + url + " - " + response.getStatusLine().toString()); return; }
4. Solution
Updating the content of this error message from [addSeedDocuments error] to [getDocumentVersions error]
5. Suggested source code (based on release 2.22.1)
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; }