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
Since WasmError encodes all guest errors as a string, we could makes error details easier to parse by encoding as a json object within the message itself. E.g. instead of the js client receiving: {"name":"internal_error","message":"Source chain error: InvalidCommit error: Recipe needs at least 1 trusted author"}
It could instead receive: {"name":"internal_error","message":"Source chain error: InvalidCommit error: __ERR_START__{"type":"InvalidRecipe","reasons":[{"type":"NoTrustedAuthors"},{"type":"UndeclaredVar","var_name":"foo"}]}__ERR_END__"}
And to complement this we could generate TS counterparts:
Extracting this information can then be done by parsing the string between the delimiters.
Return ExternResult<SomeNestedTypedResult>
Coordinator functions could return errors as 'successes' to take advantage of builtin msgpack serialisation. One advantage is that is becomes simpler to bind esoteric error type to only their relevant functions.
The biggest flaw with this approach is that most hdk functions already return ExternResult, so we're already forced to be interpreting an error string much of the time.
No description provided.
The text was updated successfully, but these errors were encountered: