Skip to content

Commit

Permalink
Rework
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubhangi-cs committed Jan 8, 2024
1 parent 2abf4ee commit f727697
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import io.cdap.plugin.successfactors.common.util.ResourceConstants;
import io.cdap.plugin.successfactors.common.util.SuccessFactorsUtil;
import io.cdap.plugin.successfactors.connector.SuccessFactorsConnector;
import io.cdap.plugin.successfactors.connector.SuccessFactorsConnectorConfig;
import io.cdap.plugin.successfactors.source.config.SuccessFactorsPluginConfig;
import io.cdap.plugin.successfactors.source.input.SuccessFactorsInputFormat;
import io.cdap.plugin.successfactors.source.input.SuccessFactorsInputSplit;
Expand Down Expand Up @@ -135,8 +136,16 @@ private Schema getOutputSchema(FailureCollector failureCollector) {
} catch (TransportException te) {
String errorMsg = ExceptionParser.buildTransportError(te);
errorMsg = ResourceConstants.ERR_ODATA_SERVICE_CALL.getMsgForKeyWithCode(errorMsg);
failureCollector.addFailure(errorMsg, "Please check whether the credentials are correct.")
.withConfigProperty(SuccessFactorsPluginConfig.BASE_URL);
if ((errorMsg.contains("proxy") || errorMsg.contains("Connection reset"))) {
failureCollector.addFailure(errorMsg, "Please check whether the credentials are correct.")
.withConfigProperty(SuccessFactorsConnectorConfig.PROPERTY_PROXY_USERNAME)
.withConfigProperty(SuccessFactorsConnectorConfig.PROPERTY_PROXY_PASSWORD);
} else if (errorMsg.contains("Failed to connect")) {
failureCollector.addFailure(errorMsg, "Please check whether the credentials are correct.")
.withConfigProperty(SuccessFactorsConnectorConfig.PROPERTY_PROXY_URL);
} else {
failureCollector.addFailure(errorMsg, null).withConfigProperty(SuccessFactorsPluginConfig.BASE_URL);
}
} catch (SuccessFactorsServiceException ose) {
attachFieldWithError(ose, failureCollector);
}
Expand Down

0 comments on commit f727697

Please sign in to comment.