|
|
@ -24,19 +24,20 @@ function setupRaven(opts) { |
|
|
|
transport: function(opts) { |
|
|
|
transport: function(opts) { |
|
|
|
const report = opts.data |
|
|
|
const report = opts.data |
|
|
|
// simplify certain complex error messages
|
|
|
|
// simplify certain complex error messages
|
|
|
|
report.exception.values.forEach(item => { |
|
|
|
if (report.exception && report.exception.values) { |
|
|
|
let errorMessage = item.value |
|
|
|
report.exception.values.forEach(item => { |
|
|
|
// simplify ethjs error messages
|
|
|
|
let errorMessage = item.value |
|
|
|
errorMessage = extractEthjsErrorMessage(errorMessage) |
|
|
|
// simplify ethjs error messages
|
|
|
|
// simplify 'Transaction Failed: known transaction'
|
|
|
|
errorMessage = extractEthjsErrorMessage(errorMessage) |
|
|
|
if (errorMessage.indexOf('Transaction Failed: known transaction') === 0) { |
|
|
|
// simplify 'Transaction Failed: known transaction'
|
|
|
|
// cut the hash from the error message
|
|
|
|
if (errorMessage.indexOf('Transaction Failed: known transaction') === 0) { |
|
|
|
errorMessage = 'Transaction Failed: known transaction' |
|
|
|
// cut the hash from the error message
|
|
|
|
} |
|
|
|
errorMessage = 'Transaction Failed: known transaction' |
|
|
|
// finalize
|
|
|
|
} |
|
|
|
item.value = errorMessage |
|
|
|
// finalize
|
|
|
|
}) |
|
|
|
item.value = errorMessage |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
// modify report urls
|
|
|
|
// modify report urls
|
|
|
|
rewriteReportUrls(report) |
|
|
|
rewriteReportUrls(report) |
|
|
|
// make request normally
|
|
|
|
// make request normally
|
|
|
@ -52,11 +53,13 @@ function rewriteReportUrls(report) { |
|
|
|
// update request url
|
|
|
|
// update request url
|
|
|
|
report.request.url = toMetamaskUrl(report.request.url) |
|
|
|
report.request.url = toMetamaskUrl(report.request.url) |
|
|
|
// update exception stack trace
|
|
|
|
// update exception stack trace
|
|
|
|
report.exception.values.forEach(item => { |
|
|
|
if (report.exception && report.exception.values) { |
|
|
|
item.stacktrace.frames.forEach(frame => { |
|
|
|
report.exception.values.forEach(item => { |
|
|
|
frame.filename = toMetamaskUrl(frame.filename) |
|
|
|
item.stacktrace.frames.forEach(frame => { |
|
|
|
|
|
|
|
frame.filename = toMetamaskUrl(frame.filename) |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function toMetamaskUrl(origUrl) { |
|
|
|
function toMetamaskUrl(origUrl) { |
|
|
|