Skip to content

Commit

Permalink
Don't catch other 4xx errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dacook committed Dec 17, 2024
1 parent 0616827 commit a3a7968
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/webpacker/js/turbo.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ document.addEventListener("turbo:submit-end", (event) => {
});

function showError(status) {
// Note that other 4xx errors will be handled differently.
if(status == 401) {
alert(I18n.t("errors.unauthorized.message"));
} else if(status === undefined) {
alert(I18n.t("errors.network_error.message"));
} else {
} else if (status >= 500) {
alert(I18n.t("errors.general_error.message"));
}
}

0 comments on commit a3a7968

Please sign in to comment.