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,11 +1,12 @@
|
||||
const rust = import('./fetch');
|
||||
|
||||
rust
|
||||
.then(m => {
|
||||
m.run().then((data) => {
|
||||
console.log(data);
|
||||
|
||||
rust.then(m => {
|
||||
m.run().then((data) => {
|
||||
console.log(data);
|
||||
|
||||
console.log("The latest commit to the wasm-bindgen %s branch is:", data.name);
|
||||
console.log("%s, authored by %s <%s>", data.commit.sha, data.commit.commit.author.name, data.commit.commit.author.email);
|
||||
})
|
||||
});
|
||||
console.log("The latest commit to the wasm-bindgen %s branch is:", data.name);
|
||||
console.log("%s, authored by %s <%s>", data.commit.sha, data.commit.commit.author.name, data.commit.commit.author.email);
|
||||
})
|
||||
})
|
||||
.catch(console.error);
|
||||
|
Reference in New Issue
Block a user