Using JSError in local Rust tests? #3572
Unanswered
kristian1108
asked this question in
Q&A
Replies: 1 comment 3 replies
-
I'm not entirely sure how this could be actionable by How did you end up exactly in this situation? I'm surprised you are using a |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm new to this wasm ecosystem so apologies if this is a silly issue/question.
I'm trying to test my wasm module inside the Rust project, the same way I would do with a normal Rust crate. I'm running into an issue where I can't pass errors outside of the wasm functions that are compatible with my local architecture. For example:
If this method returns an error, it will panic my tests with:
After tracing through the code, I discovered this is originating in the
JsError::new()
call. You cannot instantiate aJSError
outside of a wasm architecture.Is there a way to get around this so I can pass helpful errors back in my test code?
One solution is to dynamically compile in a different error. For example:
But this seems like a lot of headache for what I have to think is a very common problem? Thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions