wrap-cli icon indicating copy to clipboard operation
wrap-cli copied to clipboard

Panic with subinvoke error fails because of parse error

Open nerfZael opened this issue 2 years ago • 2 comments

Currently, in most cases, it is not possible to panic inside of a wasm wrapper with the error you get from a subinvocation. This is most likely due to the way WrapError is de/serialized and lack of support for error aggregation. Example wasm wrapper code:

let result = TestModule.doWithError();
if let Err(err) = result {
    panic!("{}", err);
}

Expected result: Should throw with the error from subinvoke. Actual result: The following error is received: Error: Failed to parse WrapError.

nerfZael avatar Mar 24 '23 14:03 nerfZael

I'm unable to replicate the issue with this:

let result = ImportedInvokeModule::invoke_throw_error(
    &imported::imported_invoke_module::ArgsInvokeThrowError { a: args.a },
);
if let Err(err) = result {
    panic!("{}", err);
}

Do your remember any more details about when the failure occurred?

krisbitney avatar May 13 '23 13:05 krisbitney

Added context: Should try to reproduce using ENS text record resolver wrapper by subinvoking to Ethereum wrapper for a text record that does not exist

The issue seems to happen in other URI Resolver extension wrappers as well

krisbitney avatar May 15 '23 16:05 krisbitney