Skip to content

Commit

Permalink
Error catching in ui_load
Browse files Browse the repository at this point in the history
  • Loading branch information
dmotte committed Mar 7, 2024
1 parent ae2a935 commit e7f08c4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bnplay-audio-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,16 @@
function ui_load() {
btnToggle = document.getElementById("btnToggle");

return bnp_load().then(() => {
btnToggle.removeAttribute("disabled");
ui_update();
});
return bnp_load()
.then(() => {
btnToggle.removeAttribute("disabled");
ui_update();
})
.catch((error) => {
console.log(error);
divStatus.innerHTML = error;
btnToggle.value = "ERROR";
});
}

function ui_update() {
Expand Down

0 comments on commit e7f08c4

Please sign in to comment.