You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Task 5: Pay specific attention to the error returned by the RPC. Sometimes, the error is vague and not informative enough according to the context. We should provide a custom error with additional information in those cases.
TODO: use Taquito in different ways to generate failure from the RPC, inspect the error coming from the RPC, identify error messages that would benefit from clarification, and make the appropriate changes. Here are two examples that need to be addressed:
When trying to fetch a big map value using a key of the wrong type (for example, using X where a nat was expected), an error from the node bubble up and is hard to diagnose:
Uncaught (in promise) HttpResponse: Http error response: (400) Failed to parse the request body: No case matched:
Unhandled error (Invalid_argument "Z.of_substring_base: invalid digit")
Missing object field string
Missing object field bytes
Unexpected object instead of array
Missing object field prim
at HttpBackend.<anonymous> (http://localhost:3030/node_modules/.vite/deps/chunk-V4G7R2DB.js?v=4243d8f3:1552:17)
at Generator.throw (<anonymous>)
at rejected (http://localhost:3030/node_modules/.vite/deps/chunk-V4G7R2DB.js?v=4243d8f3:1390:32)
An error comes from the RPC when estimating an operation using an account with a balance too low (Tezos.estimate.transfer got 400 #363). TODO: validate if the behavior is still the same; the issue was opened in 2020.
HttpResponseError {
message: 'Http error response: (400) Failed to parse the request body: No case matched:\n' +
' At /kind, unexpected string instead of endorsement\n' +
' At /kind, unexpected string instead of seed_nonce_revelation\n' +
' At /kind, unexpected string instead of double_endorsement_evidence\n' +
' At /kind, unexpected string instead of double_baking_evidence\n' +
' At /kind, unexpected string instead of activate_account\n' +
' At /kind, unexpected string instead of proposals\n' +
' At /kind, unexpected string instead of ballot\n' +
' At /kind, unexpected string instead of reveal\n' +
' At /destination:\n' +
' Unhandled error (Failure "Invalid contract notation.")\n' +
' At /kind, unexpected string instead of origination\n' +
' At /kind, unexpected string instead of delegation',
status: 400,
statusText: 'Bad Request',
body: 'Failed to parse the request body: No case matched:\n' +
' At /kind, unexpected string instead of endorsement\n' +
' At /kind, unexpected string instead of seed_nonce_revelation\n' +
' At /kind, unexpected string instead of double_endorsement_evidence\n' +
' At /kind, unexpected string instead of double_baking_evidence\n' +
' At /kind, unexpected string instead of activate_account\n' +
' At /kind, unexpected string instead of proposals\n' +
' At /kind, unexpected string instead of ballot\n' +
' At /kind, unexpected string instead of reveal\n' +
' At /destination:\n' +
' Unhandled error (Failure "Invalid contract notation.")\n' +
' At /kind, unexpected string instead of origination\n' +
' At /kind, unexpected string instead of delegation',
name: 'HttpResponse'
}
The text was updated successfully, but these errors were encountered:
Follow up of #160 as described in https://hackmd.io/@tca0T8LZT3au8LG6hSX20g/r1zTRTlfj_
Task 5: Pay specific attention to the error returned by the RPC. Sometimes, the error is vague and not informative enough according to the context. We should provide a custom error with additional information in those cases.
TODO: use Taquito in different ways to generate failure from the RPC, inspect the error coming from the RPC, identify error messages that would benefit from clarification, and make the appropriate changes. Here are two examples that need to be addressed:
The text was updated successfully, but these errors were encountered: