Skip to content

Commit bb8d282

Browse files
Docs: Update webtool example to show errors in alert.
1 parent c77dc1a commit bb8d282

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

docs/examples/microbit-uh.umd.js

Lines changed: 7 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/examples/webtool.html

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -262,16 +262,20 @@ <h2>V2 Intel Hex</h2>
262262
console.error(errorMsg);
263263
alert(errorMsg);
264264
}
265-
let universalHex = microbitUh.createUniversalHex([
266-
{
267-
hex: v1HexStr,
268-
boardId: 0x9900,
269-
},
270-
{
271-
hex: v2HexStr,
272-
boardId: 0x9903,
273-
},
274-
]);
265+
try {
266+
let universalHex = microbitUh.createUniversalHex([
267+
{
268+
hex: v1HexStr,
269+
boardId: 0x9900,
270+
},
271+
{
272+
hex: v2HexStr,
273+
boardId: 0x9903,
274+
},
275+
]);
276+
} catch (e) {
277+
return alert(e);
278+
}
275279
downloadTextFile('universal-hex.hex', universalHex);
276280
});
277281
</script>

0 commit comments

Comments
 (0)