mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 12:31:22 +00:00
Add catch(console.error)
to all examples
Some examples have been failing to load in some browsers, and this ensures that whenever the promise to load Rust code fails we log any errors happening instead of accidentally failing silently. This helped debug a bit in #897
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
// For more comments about what's going on here, check out the `hello_world`
|
||||
// example.
|
||||
import('./canvas').then(canvas => {
|
||||
canvas.draw();
|
||||
});
|
||||
import('./canvas')
|
||||
.then(canvas => canvas.draw())
|
||||
.catch(console.error);
|
||||
|
Reference in New Issue
Block a user