#Can you take in an error as a function argument?

1 messages · Page 1 of 1 (latest)

high coyote
#

i'm making a custom panic function (thats noreturn ) to improve my WASM error handling but I want to pass in an error to the function to print it out and more, is there a way to do that?

placid condor
#

maybe something like

fn handleError(val: anyerror) noreturn {}
molten wraith
#

what do you mean by error in this context? if it's an instance of an error set, then just,

fn foo(err: ErrorSet)

of

fn foo(err: anyerror)