diff --git a/src/main/java/io/cdap/plugin/successfactors/source/SuccessFactorsSource.java b/src/main/java/io/cdap/plugin/successfactors/source/SuccessFactorsSource.java index ac700b1..a599cfa 100644 --- a/src/main/java/io/cdap/plugin/successfactors/source/SuccessFactorsSource.java +++ b/src/main/java/io/cdap/plugin/successfactors/source/SuccessFactorsSource.java @@ -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; @@ -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); }