1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

sentry - setupRaven - ensure message is truthy

This commit is contained in:
kumavis 2018-05-23 22:33:02 -07:00
parent 22e59af741
commit f41198fbb6

View File

@ -66,11 +66,11 @@ function simplifyErrorMessages(report) {
function rewriteErrorMessages(report, rewriteFn) {
// rewrite top level message
report.message = rewriteFn(report.message)
if (typeof report.message === 'string') report.message = rewriteFn(report.message)
// rewrite each exception message
if (report.exception && report.exception.values) {
report.exception.values.forEach(item => {
item.value = rewriteFn(item.value)
if (typeof item.value === 'string') item.value = rewriteFn(item.value)
})
}
}