From 28e2354583e3e9ef8477363f23eab86bb9c78625 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 12 Mar 2020 10:51:05 -0300 Subject: [PATCH] Fix Sentry error processing for errors missing a stack (#8179) 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. --- app/scripts/lib/setupSentry.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/scripts/lib/setupSentry.js b/app/scripts/lib/setupSentry.js index b1f65246b..c1361a6c5 100644 --- a/app/scripts/lib/setupSentry.js +++ b/app/scripts/lib/setupSentry.js @@ -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) + }) + } }) } }