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

Merge pull request #3765 from MetaMask/sentry-error-simplify

sentry - simplify error message 'Transaction Failed: known transaction'
This commit is contained in:
Frankie 2018-03-28 12:55:52 -07:00 committed by GitHub
commit 06112b3e30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,10 +23,20 @@ function setupRaven(opts) {
release,
transport: function(opts) {
const report = opts.data
// simplify ethjs error messages
// simplify certain complex error messages
report.exception.values.forEach(item => {
item.value = extractEthjsErrorMessage(item.value)
let errorMessage = item.value
// simplify ethjs error messages
errorMessage = extractEthjsErrorMessage(errorMessage)
// simplify 'Transaction Failed: known transaction'
if (errorMessage.indexOf('Transaction Failed: known transaction') === 0) {
// cut the hash from the error message
errorMessage = 'Transaction Failed: known transaction'
}
// finalize
item.value = errorMessage
})
// modify report urls
rewriteReportUrls(report)
// make request normally