|
|
|
@ -24,6 +24,7 @@ function setupRaven(opts) { |
|
|
|
|
transport: function(opts) { |
|
|
|
|
const report = opts.data |
|
|
|
|
// simplify certain complex error messages
|
|
|
|
|
if (report.exception && report.exception.values) { |
|
|
|
|
report.exception.values.forEach(item => { |
|
|
|
|
let errorMessage = item.value |
|
|
|
|
// simplify ethjs error messages
|
|
|
|
@ -36,7 +37,7 @@ function setupRaven(opts) { |
|
|
|
|
// finalize
|
|
|
|
|
item.value = errorMessage |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
// modify report urls
|
|
|
|
|
rewriteReportUrls(report) |
|
|
|
|
// make request normally
|
|
|
|
@ -52,12 +53,14 @@ function rewriteReportUrls(report) { |
|
|
|
|
// update request url
|
|
|
|
|
report.request.url = toMetamaskUrl(report.request.url) |
|
|
|
|
// 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) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function toMetamaskUrl(origUrl) { |
|
|
|
|
const filePath = origUrl.split(location.origin)[1] |
|
|
|
|