LP#1268619: JS status codes can come across as numbers; stringify for match
authorBill Erickson <berick@esilibrary.com>
Thu, 10 Jul 2014 15:29:49 +0000 (11:29 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 19 Aug 2014 22:54:47 +0000 (15:54 -0700)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

src/javascript/opensrf.js

index a31c550..29cf6bf 100644 (file)
@@ -633,7 +633,7 @@ OpenSRF.Stack.handle_message = function(ses, osrf_msg) {
         }
 
         // capture all 400's and 500's as method errors
-        if (status.match(/^4/) || status.match(/^5/)) {
+        if ((status+'').match(/^4/) || (status+'').match(/^5/)) {
             if(req && req.onmethoderror) 
                 return req.onmethoderror(req, status, status_text);
         }