Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ public static OAuthInfo getOAuthInfo(SalesforceConnectorInfo config, FailureColl
} catch (Exception e) {
String message = getSalesforceErrorMessageFromException(e);
collector.addFailure("Error encountered while establishing connection: " + message,
"Please verify authentication properties are provided correctly")
.withStacktrace(e.getStackTrace());
"Please verify authentication properties are provided correctly");
throw collector.getOrThrowException();
}
return oAuthInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ public void validate(FailureCollector collector, @Nullable OAuthInfo oAuthInfo)
queryDescriptor = SalesforceQueryParser.getObjectDescriptorFromQuery(query);
} catch (SOQLParsingException e) {
collector.addFailure(String.format("Invalid SOQL query '%s' : %s", query, e.getMessage()), null)
.withStacktrace(e.getStackTrace())
.withConfigProperty(SalesforceSourceConstants.PROPERTY_QUERY);
throw collector.getOrThrowException();
}
Expand Down Expand Up @@ -255,8 +254,7 @@ private void validateCompoundFields(String sObjectName, List<String> fieldNames,
String errorMessage = SalesforceConnectionUtil.getSalesforceErrorMessageFromException(e);
collector.addFailure(
String.format("Cannot establish connection to Salesforce to describe SObject: '%s' with error %s",
sObjectName, errorMessage), null)
.withStacktrace(e.getStackTrace());
sObjectName, errorMessage), null);
Comment on lines 255 to +257

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When a connection exception occurs while describing the SObject, we should immediately throw the collected exception to stop the validation process. Continuing validation when the connection is down can lead to redundant connection attempts and duplicate error messages in subsequent validation steps (such as validatePKChunk).

      collector.addFailure(
          String.format("Cannot establish connection to Salesforce to describe SObject: '%s' with error %s",
                        sObjectName, errorMessage), null);
      throw collector.getOrThrowException();

}
}

Expand Down Expand Up @@ -353,7 +351,7 @@ private boolean isCustomObject(String sObjectName, FailureCollector collector, O
} catch (ConnectionException e) {
String message = SalesforceConnectionUtil.getSalesforceErrorMessageFromException(e);
collector.addFailure(String.format("There was issue communicating with Salesforce due to error: %s", message),
null).withStacktrace(e.getStackTrace());
null);
Comment on lines 353 to +354

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Fix a minor grammatical typo in the error message: 'There was issue' should be 'There was an issue'.

Suggested change
collector.addFailure(String.format("There was issue communicating with Salesforce due to error: %s", message),
null).withStacktrace(e.getStackTrace());
null);
collector.addFailure(String.format("There was an issue communicating with Salesforce due to error: %s", message),
null);

throw collector.getOrThrowException();
}
}
Expand Down
Loading