Skip to content

[🍒]fix: remove error stack trace from validation failures#358

Merged
vikasrathee-cs merged 1 commit into
data-integrations:release/1.7from
cloudsufi:cherry-pick/c1e11abf6aa72c63f777702c0789c335c77404b7
Jun 5, 2026
Merged

[🍒]fix: remove error stack trace from validation failures#358
vikasrathee-cs merged 1 commit into
data-integrations:release/1.7from
cloudsufi:cherry-pick/c1e11abf6aa72c63f777702c0789c335c77404b7

Conversation

@harishhk107
Copy link
Copy Markdown
Contributor

@harishhk107 harishhk107 commented Jun 4, 2026

During configuration validation in SalesforceSourceConfig and SalesforceConnectionUtil, attaching a Java exception stack trace (.withStacktrace()) to validation failures caused the hosting runtime (Connectors Service) to classify user configuration errors as internal system faults.

Removing .withStacktrace() consistently across these validation call sites ensures the runtime correctly treats configuration failures as standard user errors, successfully propagating exact Salesforce error messages and error IDs to the client.

This stack trace was exposing a lot of user information which is not required to debug or get the root cause of the issue.

@harishhk107 harishhk107 changed the title fix: remove error stack trace from validation failures [🍒]fix: remove error stack trace from validation failures Jun 4, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes calls to .withStacktrace(e.getStackTrace()) when adding failures to the FailureCollector across several files. The review feedback suggests throwing the collected exception immediately in validateCompoundFields to halt validation when a connection failure occurs, and fixing a minor grammatical typo in an error message.

Comment on lines 255 to +257
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);
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();

Comment on lines 353 to +354
collector.addFailure(String.format("There was issue communicating with Salesforce due to error: %s", message),
null).withStacktrace(e.getStackTrace());
null);
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);

@vikasrathee-cs vikasrathee-cs merged commit b4c2fa0 into data-integrations:release/1.7 Jun 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants