-
Notifications
You must be signed in to change notification settings - Fork 362
fix: display notification for decode contract error #3879
fix: display notification for decode contract error #3879
Conversation
CLA Assistant Lite All Contributors have signed the CLA. |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
Pull Request Test Coverage Report for Build 2353349317
💛 - Coveralls |
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.
Makes sense! Nice work!
I added a small idea we could discuss to avoid the nested try-catches.
6bf7da9
to
54315c3
Compare
We shouldn't display code 817 to the user. I would throw the original error from decode and logError 817 in the code that catches it. |
The main issue the snack bar wasn't showing and is showing now, so we should agree on what error to show. Maybe just a "transaction failed" is enough? |
In this particular case, I think we need to fix the root cause – that it doesn't decode the contract error properly. The error is GS013 – not enough gas. This is what should be displayed to the user. |
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.
You need to fix the error decoding, not tell the user that we failed decoding it.
Agree, I was reproducing the GS013 and I'm working on it |
Regarding throwing with the |
955db81
to
ff3962c
Compare
After investigating the origin of Shortly, the contract errors A better |
…-notification-on-decode-contract-error
@francovenica I've updated this branch from dev, should be good now 👍 |
I still have the same issue. I cannot create tx in this PR |
…-notification-on-decode-contract-error
Damn, sorry, updated again. Now it should work. |
@francovenica can you try some other failing txns, as per Liliya's comment:
|
This looks correct to me. The error message was changed to a generic one since contract errors often return GS013 even if it doesn't have anything to do with missing safeTxGas. |
I'd agree with Usame here. Most of the errors you get are GS013 even if there is no gas related issues. |
What it solves
Resolves #3772
How this PR fixes it
Throw a
CodeException
when unable to decode contract error message and wrapgetContractErrorMessage
in atry...catch
so decoding message errors can be caught to show a notification.How to test it
(From #3772)