Skip to content

Conversation

@billyvg
Copy link
Member

@billyvg billyvg commented Jul 29, 2022

Instead of parsing and mutating the error stack frames, use the cause property for API request errors. This also solves some cases where the stack manipulation did not work on certain browsers.

Instead of parsing and mutating the error stack frames, use the [cause](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause) property for API request errors.
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 29, 2022
@billyvg
Copy link
Member Author

billyvg commented Jul 29, 2022

This is what it looks like in our UI:

image

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

+1 for using cause more, the SDK has built-in support for it out of the box and we use it internally as well. Are there other places in Sentry where we can do this? Perhaps something to bring up in frontend TSC?

constructor(method: string | undefined, path: string) {
super(`${method || 'GET'} ${sanitizePath(path)}`);
constructor(method: string | undefined, path: string, options: ErrorOptionsObject) {
super(`${method || 'GET'} "${sanitizePath(path)}"`, options);
Copy link
Member Author

Choose a reason for hiding this comment

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

Had to quote this because of a bug in our SDK

@billyvg
Copy link
Member Author

billyvg commented Aug 2, 2022

@AbhiPrasad Not sure where else we could use this, but definitely agree we should use it more when possible

@billyvg billyvg merged commit ca265d8 into master Aug 2, 2022
@billyvg billyvg deleted the feat/ui/change-api-request-errors-use-cause branch August 2, 2022 15:16
@github-actions github-actions bot locked and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants