-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Map VM errors to FuelError
error codes
#2467
Comments
Adding the |
hey @nedsalk thanks for the heads up just for context check this file from wallet code graphql api can return multiple errors, that's why we initially had only do you think it makes sense to create 1 FuelError for each occurrence of errors that came from graphql api? that way returning always an array |
I asked @FuelLabs/client the following question:
And @Dentosal responded:
@LuizAsFight based on this, we can extract the single error from the graphql |
I reduced the scope of this issue and moved a portion of it to the below issue, as it will be easier and provide immediate value even before we can map "all" errors. Speaking of all errors, do we have a unified list of possible errors the VM can throw, or how else should we know when we mapped them all? I suspect this may be something we'll keep mapping as we go. In this sense, I created a first issue here for a recurring error: |
We have a list of VM error codes in our repo already - it's used in a similar error throwing vein, and the full list can be found here. |
@nedsalk one incorrect query can return multiple errors
response
|
I remember to have seen multiple errors before in the wallet also in other scenarios than a wrong query |
Those errors look like graphql-related errors thrown when writing custom queries. The SDK itself internally should never encounter them because we use Given that custom queries are out of the SDK's scope (currently, depending on if we work on #1570), It would be great if you could verify if the other scenarios are graphql-related or not, though. |
as the graphql natively expose errors array I would just safely keep the same pattern instead of hunt situations that multiple errors can happen. but that's my personal opinion as I like my code to be fault-proof. if multiple errors happen, I would be already prepared if you wanna assume it will be always one error only, sounds good also no big deal, up to you guys only downside I see is that if we figure this out later may need to refact something |
Going to unassign myself from this for now. |
ErrorCode
entry for every VM errorErrorCode
entry that maps to a VM error must have a test associated with it:not enough coins to fit the target
and:FuelError
with thenot-enough-coins
code is thrownFuelError.rawError
corresponds to the serialized VM error - this would be done with afetch
spycc @LuizAsFight
Note
Should be done after:
UNKNOWN
error code andrawError
property toFuelError
#2521The text was updated successfully, but these errors were encountered: