feat: add generic msg on failed transactions in toasts - #587
Conversation
metalboyrick
left a comment
There was a problem hiding this comment.
GM @Jonatan-Chaverri , thanks for your PR! You got the idea right. Leaving some comments and thoughts for improvement
- Can we improve the style? (fix the padding and margins)
-
Can we have a clickable link that points us to the specific log from the toast? so that it is easier to trace the error logs for other developers
-
Can we extract some common errors like insufficient balance or approval required? We can discuss this further if you think this is possible / not possible
|
GM @Jonatan-Chaverri, any updates on this? |
|
@metalboyrick I will work on this today and provide an update at the EOD |
c187bc3 to
b7e8824
Compare
|
@metalboyrick I have addressed the first two requests. For the third, we can have a file similar to this and translate each code to a more verbose error message, is that what you mean? if not, please elaborate a little more. Thanks. |
4a36e4e to
82646cc
Compare
|
@Jonatan-Chaverri Yeah something like that would be great, because it gives better clarity to users rather than some strange JSON. You can try out some common ones like insufficient balance, no approval. (be mindful of which errors are common which errors can be user-specific) |
1bf9c79 to
d85efc2
Compare
|
@metalboyrick I updated the PR, let me know your thoughts, thanks. |
d85efc2 to
4b28de7
Compare
|
@metalboyrick ok, made some changes to fix the margins, this is how it looks now Also, I tried getting insufficient balance error to test too and this is the error content my function is getting
I'm not aware of how all starknet common errors are printed, so the file I created is based on assumptions that at least keywords will appear in the error, but again is not 100% reliable until we can confirm that (or if you know how to confirm error messages, you can point me to it and I will update) |
|
@Jonatan-Chaverri for the margins, refer to how the transaction success modal looks, use that as the reference, i think u have a bit too much padding there (this should be easy fix) As for the errors, you can trial-and-error on what these common errors produce as text, and we can use these keywords are reference for now (not a nice solution but we can make do with this for now), ideally we can decode the bytes somehow thoughts? @gianalarcon @Nadai2010 @0xquantum3labs @jrcarlos2000 if you have any tips to give? |
4b28de7 to
9de9925
Compare
|
@metalboyrick ok, I updated the modal. Success modal is just rendering some content (string, or at least that's what I saw in most places) while I'm trying to render a custom reactNode content, so I can't just use the same, but I removed all padding now, so this is how it looks like. Regarding the error messages I'm not sure how to replicate them all from the tool, that's out of my expertise. Sorry. But will wait to hear if someone has other tips. |
After a contract is deployed, and we start interacting with this contract, some errors might arises, since these errors comes from starknet nodes, most of the time it just returns a big text with a lot of information(as showed on the issue description ), and usually the most important info is located at the end of this big text, and most of the errors are kind |
gianalarcon
left a comment
There was a problem hiding this comment.
Thanks for your contribution @Jonatan-Chaverri. I left a comment
|
Could you at least point out the exact errors you mean by "common errors" so I can try to reproduce them? |
Yes, totally agree, we should provide more context on the issue description so you can easily reproduce the errors. I think our team to work on this first. WDYT @metalboyrick ? |
|
Gm ser @Jonatan-Chaverri , I think for now we can keep the first half of the PR (the transaction message). Can we remove all logics on the verbose error part but still keep the console notifications part? |
|
I will merge this after that is done |
9de9925 to
654e0b7
Compare
654e0b7 to
a14c40e
Compare
a14c40e to
b15f396
Compare
|
GM, all done, please check @metalboyrick |






Task name here
Fixes #573
Types of change
Comments (optional)