From e360fbbbd2fe3f1ae5fa7fc371f8b57a80344409 Mon Sep 17 00:00:00 2001 From: Ramon Gutierrez Date: Sat, 17 Feb 2018 13:02:29 +0800 Subject: [PATCH] Fix ajax error catcher catching aborted calls #1 --- public/assets/js/common.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/assets/js/common.js b/public/assets/js/common.js index b0870d0c..0d6e2d48 100644 --- a/public/assets/js/common.js +++ b/public/assets/js/common.js @@ -1,5 +1,10 @@ $(function() { $(document).ajaxError(function(event, response, ajaxSettings, thrownError) { + if (response.statusText === "abort") { + // we do not catch aborted calls + return; + } + switch (response.status) { case 422: // we leave 422 handling to individual calls