-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from skip-mev/kiki/fre-381-send-anonymized-tr…
…ansaction-errors-to-sentry [FRE-381] send anonymized transaction errors to sentry
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export const isUserRejectedRequestError = (error: Error) => { | ||
if ( | ||
// keplr | metamask | ||
error.message.toLowerCase().includes("rejected") || | ||
// leap | ||
error.message.toLowerCase().includes("declined") || | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-expect-error common user rejected request error code | ||
error.code === 4001 | ||
) { | ||
return true; | ||
} | ||
return false; | ||
}; |