If serializations or deserializations fail in the code generated by macro #[dynamiclink] or #[callablepoints], the Err is unwrapped, and WASM panics.
I suggest improving the macros to enable generated functions to return Err(e) (e is made from serde::Error).
Design
It is not clear how to declare that "this function returns Err(e) when (de)serialization fails".
add an attribute like #[serde_err] to the function
all functions returning Result<T, E> returns Err(e)
2's compile is sometimes errors unexpectedly if serde::Error cannot automatically cast into E
If serializations or deserializations fail in the code generated by macro
#[dynamiclink]
or#[callablepoints]
, theErr
is unwrapped, and WASM panics. I suggest improving the macros to enable generated functions to returnErr(e)
(e
is made fromserde::Error
).Design
It is not clear how to declare that "this function returns
Err(e)
when (de)serialization fails".#[serde_err]
to the functionResult<T, E>
returnsErr(e)
2's compile is sometimes errors unexpectedly if
serde::Error
cannot automatically cast intoE