From e881ea7aaf1faea8fdbf730c09a1aadbf2366d45 Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 30 Apr 2018 12:10:15 -0700 Subject: sentry - report error-like messages using the obj message --- app/scripts/lib/setupRaven.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/scripts/lib') diff --git a/app/scripts/lib/setupRaven.js b/app/scripts/lib/setupRaven.js index b69e08bae..b1b67f771 100644 --- a/app/scripts/lib/setupRaven.js +++ b/app/scripts/lib/setupRaven.js @@ -24,6 +24,8 @@ function setupRaven(opts) { transport: function(opts) { const report = opts.data try { + // handle error-like non-error exceptions + nonErrorException(report) // simplify certain complex error messages (e.g. Ethjs) simplifyErrorMessages(report) // modify report urls @@ -40,6 +42,14 @@ function setupRaven(opts) { return Raven } +function nonErrorException(report) { + // handle errors that lost their error-ness in serialization + if (report.message.includes('Non-Error exception captured with keys: message')) { + if (!(report.extra && report.extra.__serialized__)) return + report.message = `Non-Error Exception: ${report.extra.__serialized__.message}` + } +} + function simplifyErrorMessages(report) { if (report.exception && report.exception.values) { report.exception.values.forEach(item => { -- cgit