-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't return Err(js_sys::Error)? in -> Result<(), JsValue> function #1785
Comments
alexcrichton
added a commit
to alexcrichton/wasm-bindgen
that referenced
this issue
Sep 24, 2019
To benefit users in debug mode we log any unexpected exceptions to help diagnose any issues that might arise. It turns out, though, we log this for *every* exception happening for *every* import, including imports like `__wbindgen_throw` which are explicitly intended to throw an exception. This can cause distracting debug logs to get emitted to the console, so let's squelch the debug logging for known imports that we shouldn't log for, such as intrinsics. Closes rustwasm#1785
Thanks for splitting this out! I believe this is fixed by #1788 where we were erroneously logging errors as unexpected where they were actually expected. |
alexcrichton
added a commit
that referenced
this issue
Sep 25, 2019
To benefit users in debug mode we log any unexpected exceptions to help diagnose any issues that might arise. It turns out, though, we log this for *every* exception happening for *every* import, including imports like `__wbindgen_throw` which are explicitly intended to throw an exception. This can cause distracting debug logs to get emitted to the console, so let's squelch the debug logging for known imports that we shouldn't log for, such as intrinsics. Closes #1785
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Creating a
js_sys::Error
and converting it to a JsValue will erroneously cause the glue code to catch the error you're trying to create. (Bit weird,catch
shouldn't catch an Error when it's just a return value from anew Error()
call.) I just get this in the console, printed twice.Originally posted by @cormacrelf in #1742 (comment)
Repro:
The text was updated successfully, but these errors were encountered: