From 17ae5ca5e6db6700dc4b61599c4394f80e727711 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 8 Jul 2014 09:41:12 -0400 Subject: [PATCH] LP#1268619: JS libs capture all method errors Instead of selecting specific errors to report as method errors, report all API calls which return 400 or 500-series errors as method errors. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- src/javascript/opensrf.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/javascript/opensrf.js b/src/javascript/opensrf.js index 8036c5a..a31c550 100644 --- a/src/javascript/opensrf.js +++ b/src/javascript/opensrf.js @@ -632,7 +632,8 @@ OpenSRF.Stack.handle_message = function(ses, osrf_msg) { } } - if(status == OSRF_STATUS_NOTFOUND || status == OSRF_STATUS_INTERNALSERVERERROR) { + // capture all 400's and 500's as method errors + if (status.match(/^4/) || status.match(/^5/)) { if(req && req.onmethoderror) return req.onmethoderror(req, status, status_text); } -- 2.43.2