From a3a79686db5beabbc0ba4dcabd630413c7846979 Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 17 Dec 2024 11:16:56 +1100 Subject: [PATCH] Don't catch other 4xx errors --- app/webpacker/js/turbo.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/webpacker/js/turbo.js b/app/webpacker/js/turbo.js index cd6ed4b872..4b330cdada 100644 --- a/app/webpacker/js/turbo.js +++ b/app/webpacker/js/turbo.js @@ -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")); } }