2020-01-09 04:34:58 +01:00
|
|
|
import extractEthjsErrorMessage from './extractEthjsErrorMessage'
|
2018-02-28 19:53:54 +01:00
|
|
|
|
2020-01-09 04:34:58 +01:00
|
|
|
export default reportFailedTxToSentry
|
2018-02-28 19:53:54 +01:00
|
|
|
|
|
|
|
//
|
|
|
|
// 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
|
|
|
})
|
|
|
|
}
|