This will only throw an error, seemingly without any obvious resolution.
Error: Cannot find field hash _3456837_
at VariantClass.decodeValue (.../@dfinity/candid/src/idl.ts:1018:11)
Describe the solution you'd like
One way to improve errors is to print the raw candid response along with our type:
Error: Unexpected field hash _3456837_. Did you forget to include a variant?
Received raw candid:
[
{
"_3456837_": {
"_1389388560_": "",
"_3790638545_": 3
}
}
]
Provided type:
variant {Invalid:null}
Is your feature request related to a problem? Please describe. This is an issue with
@dfinity/candid
.In general, candid decoding errors only throw an error and are not very descriptive.
Example This is an example of a candid interface with missing variants.
This will only throw an error, seemingly without any obvious resolution.
Describe the solution you'd like One way to improve errors is to print the raw candid response along with our type: