Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter sentry tx rejected errors #1580

Merged
merged 3 commits into from Jun 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/util/middlewares.js
@@ -1,5 +1,7 @@
import Logger from './Logger';

const REJECTED_TRANSACTION_ERROR = 'User rejected the transaction';

/**
* Returns a middleware that appends the DApp origin to request
* @param {{ origin: string }} opts - The middleware options
Expand Down Expand Up @@ -29,7 +31,9 @@ export function createLoggerMiddleware(opts) {
next((/** @type {Function} */ cb) => {
if (res.error) {
const { error, ...resWithoutError } = res;
Logger.error(error, { message: 'Error in RPC response', res: resWithoutError });
if (error && error.message !== REJECTED_TRANSACTION_ERROR) {
Logger.error(error, { message: 'Error in RPC response', res: resWithoutError });
}
}
if (req.isMetamaskInternal) {
return;
Expand Down