From 09b2615d82f0dbbea05b6de678b7e48cf1395470 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Wed, 15 Jan 2025 14:42:13 +0100 Subject: [PATCH] update(FhcAlert.js): if the request was aborted, no error message is shown to the user --- public/js/plugin/FhcAlert.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/js/plugin/FhcAlert.js b/public/js/plugin/FhcAlert.js index d280117ca..fc3c3bace 100644 --- a/public/js/plugin/FhcAlert.js +++ b/public/js/plugin/FhcAlert.js @@ -263,6 +263,10 @@ export default { return false; }, handleSystemError(error) { + // don't show an error message to the user if the error was an aborted request + if(error.hasOwnProperty('name') && error.name.toLowerCase() === "AbortError".toLowerCase()) + return; + // Error is string if (typeof error === 'string') return $fhcAlert.alertSystemError(error); @@ -279,6 +283,7 @@ export default { if (typeof error === 'object' && error !== null) { let errMsg = ''; + if (error.hasOwnProperty('response') && error.response?.data?.retval) errMsg += 'Error Message: ' + (error.response.data.retval.message || error.response.data.retval) + '\r\n'; else if (error.hasOwnProperty('message'))