2018-03-27 21:37:30 +02:00
|
|
|
const extractEthjsErrorMessage = require('./extractEthjsErrorMessage')
|
2018-02-28 19:53:54 +01:00
|
|
|
|
|
|
|
module.exports = reportFailedTxToSentry
|
|
|
|
|
|
|
|
//
|
|
|
|
// utility for formatting failed transaction messages
|
|
|
|
// for sending to sentry
|
|
|
|
//
|
|
|
|
|
2018-10-20 08:22:50 +02:00
|
|
|
function reportFailedTxToSentry ({ sentry, txMeta }) {
|
2018-03-27 21:37:30 +02:00
|
|
|
const errorMessage = 'Transaction Failed: ' + extractEthjsErrorMessage(txMeta.err.message)
|
2018-10-20 08:22:50 +02:00
|
|
|
sentry.captureMessage(errorMessage, {
|
2018-02-28 19:53:54 +01:00
|
|
|
// "extra" key is required by Sentry
|
2018-10-19 11:30:21 +02:00
|
|
|
extra: { txMeta },
|
2018-02-28 19:53:54 +01:00
|
|
|
})
|
|
|
|
}
|