From: Bill Erickson Date: Tue, 8 Jul 2014 13:41:12 +0000 (-0400) Subject: LP#1268619: JS libs capture all method errors X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=17ae5ca5e6db6700dc4b61599c4394f80e727711;p=working%2FOpenSRF.git 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 --- 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); }