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 Sentry error processing for errors missing a stack #8179

Merged
merged 1 commit into from Mar 12, 2020

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Mar 11, 2020

Errors without stack traces would break the Sentry error processing, which assumes the presence of a stack trace. Many errors don't have any stack trace though, such as uncaught promises.

This breakage resulting in the app state being missing from the error report, and a console warning.

Errors without stack traces would break the Sentry error processing,
which assumes the presence of a stack trace. Many errors don't have any
stack trace though, such as uncaught promises.

This breakage resulting in the app state being missing from the error
report, and a console warning.
@metamaskbot
Copy link
Collaborator

Builds ready [566e19a]
Page Load Metrics (671 ± 69 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeNotificationfirstPaint36111512010
domContentLoaded37486167014369
load37586367114369
domInteractive37486166914369

Copy link
Contributor

@whymarrh whymarrh left a comment

Choose a reason for hiding this comment

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

Could we use options chaining here?

@Gudahtt
Copy link
Member Author

Gudahtt commented Mar 11, 2020

I'm not sure how optional chaining applies 😕 This line isn't an assignment - it's looping through and mutating the array.

@whymarrh
Copy link
Contributor

item.stacktrace?.frames

Instead of adding the check for stacktrace, we could use ?.

@Gudahtt
Copy link
Member Author

Gudahtt commented Mar 11, 2020

Ah right - it hadn't occurred to me to use optional chaining in the case where you aren't using the return value. Sure, I can update this.

@Gudahtt
Copy link
Member Author

Gudahtt commented Mar 11, 2020

Unfortunately using optional chaining without capturing the result in a variable triggers the no-unused-expressions eslint rule, due to this bug. I'd rather leave this as-is for now rather than add an ignore comment.

@Gudahtt Gudahtt merged commit 28e2354 into develop Mar 12, 2020
@Gudahtt Gudahtt deleted the fix-error-processing-when-stack-missing branch March 12, 2020 13:51
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.

None yet

3 participants