Skip to content
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

Document that error types other than JsValue are supported #3054

Merged
merged 1 commit into from
Sep 1, 2022

Conversation

Liamolucko
Copy link
Collaborator

Resolves #1004

#2710 added support for returning Result<T, impl Into<JsValue>> rather than just Result<T, JsValue>, but the wasm-bindgen guide still claims that only the latter is supported.

This fixes that, and also fixes a mistake in the table for what forms Result can be returned in (it previously claimed that only Option<Result<...>> was supported, when in fact only a plain Result<...> is supported).

Resolves rustwasm#1004

rustwasm#2710 added support for returning `Result<T, impl Into<JsValue>>` rather than just `Result<T, JsValue>`, but the `wasm-bindgen` guide still claims that only the latter is supported.

This fixes that, and also fixes a mistake in the table for what forms `Result` can be returned in (it previously claimed that only `Option<Result<...>>` was supported, when in fact only a plain `Result<...>` is supported).
@alexcrichton alexcrichton merged commit c890dc3 into rustwasm:main Sep 1, 2022
@Liamolucko Liamolucko deleted the docs-arbitrary-errors branch September 1, 2022 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow for returning custom error type in Result
2 participants