Enable to catch serde error in dynamic link
Opened this issue · 0 comments
loloicci commented
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>
returnsErr(e)
2's compile is sometimes errors unexpectedly if serde::Error
cannot automatically cast into E