-
Notifications
You must be signed in to change notification settings - Fork 7
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
Don't show TX error messages for empty error blocks #1444
base: master
Are you sure you want to change the base?
Conversation
Deployed to Cloudflare Pages
|
286f546
to
f7c66a2
Compare
This is marked as draft until someone can verify that my interpretation of the situation is correct. |
Yes: @kostko says that
So, we don't have to show an error message here. |
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why check for a module? I think simplification should suffice:
if (!error || (!error.module && !error.code)) return undefined | |
if (!error?.code) return undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why check for a module?
Because I don't know if we can assume that all possible modules (i.e. sources of errors) are sane enough to use the 0 error code for success.
There might be some deranged modules that break the convention.
Generally speaking, when hiding error messages, I want to be as narrow and specific as possible. We know that no module and error code 0 is not a problem, so we can hide this, but nothing else.
If we see more useless error messages later, we can also hide them later...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a TODO, if this ever gets resolved upstream.
Frontend should not be fixing this |
How about we create an issue upstream? |
The discussion with the Nexus guys have been going on for 3 days now.
I agree, but waiting for @lukaw3d's decision.
Exactly. |
🤷 seems very rare, and frontend can't correctly fix the transaction anyway: method missing, and status missing |
Not much progress with the Nexus issue for the last 3 weeks. I still thing we ought to merge the frontend workaround, at least in order to remove the spurious error message... |
Some transactions have an
error
block like this:An example found by @matevz is available here.
In these cases, no error message should be shown.