Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: expand mdTransfer error #1275

Merged
merged 2 commits into from
Apr 5, 2024
Merged

fix: expand mdTransfer error #1275

merged 2 commits into from
Apr 5, 2024

Conversation

cristiand391
Copy link
Member

What does this PR do?

updates MetadataTransfer.pollStatus error handling to expand the mdTransfer error with error data/actions if the failure throws an SfError.

An example of this is STL throwing on source-tracking after a CLI deploy (which happens on the postdeploy hook on SDR).
One customer is getting the multiple git error iso-git failure on STL but the path errors don't show up in the CLI final error.
See this thread:
https://salesforce-internal.slack.com/archives/G02K6C90RBJ/p1711480148180689

What issues does this PR fix or reference?

@W-15347866@

Functionality Before

errors in post retrieve/deploy get swallowed in mdTransfer catch block.

Functionality After

mdTransfer will include cause error data (if instanceof SfError) and actions.

<insert gif and/or summary>

@cristiand391 cristiand391 requested a review from a team as a code owner April 3, 2024 14:20
@cristiand391 cristiand391 changed the title Cd/show isogit err fix: expand mdTransfer error Apr 3, 2024
error.setData({
id: this.id,
});

if (error.stack && err.stack) {
Copy link
Contributor

Choose a reason for hiding this comment

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

how would error.stack ever be truthy if we just constructed it?

Copy link
Member Author

Choose a reason for hiding this comment

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

all errors have a stack trace set when instantiated:

node -e  'const err= new Error(); console.log(err.stack);'
Screenshot 2024-04-03 at 6 23 26 PM

@@ -115,14 +115,26 @@ export abstract class MetadataTransfer<
}
return result;
} catch (e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this might be better as an exported function (pass in the e and the id) so that we could have a UT that imports it and throws various errors at it (regular Error, SfError, an isogit error) and asserts that we're giving back SfErrors with the correct input.

@mshanemc mshanemc merged commit 8e12937 into main Apr 5, 2024
71 checks passed
@mshanemc mshanemc deleted the cd/show-isogit-err branch April 5, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants