mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
sentry - report error-like messages using the obj message
This commit is contained in:
parent
2a8d3ea450
commit
e881ea7aaf
@ -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 => {
|
||||
|
Loading…
Reference in New Issue
Block a user