From 572c8449b9b6b1daee1d5559ebbd73c8b56ea306 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Fri, 30 May 2014 12:25:47 -0500 Subject: [PATCH] * VRFS-1575 - implemented isNetworkError --- web/app/assets/javascripts/utils.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web/app/assets/javascripts/utils.js b/web/app/assets/javascripts/utils.js index 470f60e5e..7e482aeb9 100644 --- a/web/app/assets/javascripts/utils.js +++ b/web/app/assets/javascripts/utils.js @@ -795,9 +795,14 @@ } } + + // pass in 'arguments' in a fail callback of a $.ajax context.JK.isNetworkError = function(failArgs) { - return false; - } + if(failArgs.length != 3) throw "expected 3 arguments from .fail of $ajax in isNetworkError" + var xhr = failArgs[0]; + + return xhr.status == 0; + } context.JK.clientType = function () { if (context.jamClient) {