Skip to content

Commit

Permalink
Don't show TX error messages for empty error blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
csillag committed Jun 5, 2024
1 parent f9b0642 commit f7c66a2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .changelog/1444.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Don't show TX error messages for empty error blocks
2 changes: 1 addition & 1 deletion src/app/components/StatusIcon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const StatusIcon: FC<StatusIconProps> = ({ success, error, withText }) =>
&nbsp;
{statusIcon[status]}
</StyledBox>
{error && <ErrorBox>{errorMessage}</ErrorBox>}
{errorMessage && <ErrorBox>{errorMessage}</ErrorBox>}
</>
)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/app/hooks/useTxErrorMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { TxError } from '../../oasis-nexus/api'

export const useTxErrorMessage = (error: TxError | undefined): string | undefined => {
const { t } = useTranslation()
if (!error) return undefined
if (!error || (!error.module && !error.code)) return undefined
if (error.module === 'evm' && error.code === 8 && !error.message) {
// EVM reverted, with missing error message
return `${t('errors.revertedWithoutMessage')} (${t('errors.code')} ${error.code})`
Expand Down

0 comments on commit f7c66a2

Please sign in to comment.