You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add better error messages to the wasm bindings - the current implementation doesn't provide a stack trace.
Currently most functions return Result<T, JsValue> and this gives an error message but the context is lost. The Error type from the js-sys crate should be used instead: Result<T, js_sys::Error>
Should already be a version include by wasm-bindgen (check Cargo.lock) but will need to be included to access the API.
To-do list
Replace Result<T, JsValue> functions with Result<T, js_sys::Error> wherever appropriate
Change checklist
The feature or fix is implemented in Rust and across all bindings whereas possible.
The feature or fix has sufficient testing coverage
All tests and examples build and run locally as expected
Every piece of code has been document according to the documentation guidelines.
If conceptual documentation (mdbook) and examples highlighting the feature exist, they are properly updated.
If the feature is not currently documented, a documentation task Issue has been opened to address this.
The text was updated successfully, but these errors were encountered:
l1h3r
added
good first issue
Wasm
Related to Wasm bindings. Becomes part of the Wasm changelog
Added
A new feature that requires a minor release. Part of "Added" section in changelog
labels
Mar 2, 2021
Err > InvalidNetworkName: Invalid Network Name: network name cannot exceed 6 characters
at module.exports.__wbg_new_80811dcb66d1b53f (~/git/identity.rs/bindings/wasm/node/identity_wasm.js:4009:15)
at js_sys::Error::new::he73bdbceea59ac14 (<anonymous>:wasm-function[5359]:0x31937b)
at identity_wasm::error::wasm_error::h2992dc7d9d8702bc (<anonymous>:wasm-function[1645]:0x277fef)
at identity_wasm::did::wasm_document::WasmDocument::new::ha36dfed4e964f01f (<anonymous>:wasm-function[418]:0x17ac2e)
at document_new (<anonymous>:wasm-function[3069]:0x2ee198)
at new Document (~/git/identity.rs/bindings/wasm/node/identity_wasm.js:1358:24)
at o (~/git/identity.rs/bindings/wasm/examples/dist/node.js:1:338)
at ~/git/identity.rs/bindings/wasm/examples/dist/node.js:1:7333
at ~/git/identity.rs/bindings/wasm/examples/dist/node.js:1:8320
at Object.<anonymous> (~/git/identity.rs/bindings/wasm/examples/dist/node.js:1:8396)
In particular, the returned error is also an instanceof Error.
Description
Add better error messages to the wasm bindings - the current implementation doesn't provide a stack trace.
Currently most functions return
Result<T, JsValue>
and this gives an error message but the context is lost. TheError
type from thejs-sys
crate should be used instead:Result<T, js_sys::Error>
Resources
wasm-bindgen
(checkCargo.lock
) but will need to be included to access the API.To-do list
Result<T, JsValue>
functions withResult<T, js_sys::Error>
wherever appropriateChange checklist
The text was updated successfully, but these errors were encountered: