Skip to content

Commit

Permalink
Fix Sentry error processing for errors missing a stack (#8179)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Gudahtt committed Mar 12, 2020
1 parent 2b3acfc commit 28e2354
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/scripts/lib/setupSentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ function rewriteReportUrls (report) {
// update exception stack trace
if (report.exception && report.exception.values) {
report.exception.values.forEach((item) => {
item.stacktrace.frames.forEach((frame) => {
frame.filename = toMetamaskUrl(frame.filename)
})
if (item.stacktrace) {
item.stacktrace.frames.forEach((frame) => {
frame.filename = toMetamaskUrl(frame.filename)
})
}
})
}
}
Expand Down

0 comments on commit 28e2354

Please sign in to comment.