End action if an error is encountered

This commit is contained in:
Joel Male 2021-02-26 13:50:26 +10:00
parent 732ff79473
commit 528d756289
1 changed files with 2 additions and 0 deletions

View File

@ -26,6 +26,7 @@ async function run() {
if (res.status >= 400) {
// throw an error
error(res.status);
return;
}
// output the status
@ -37,6 +38,7 @@ async function run() {
})
.catch((err) => {
error(err.status);
return;
});
}