From d6d567d758900641c9036e5db1775d1434d42f93 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 2 Apr 2009 19:59:49 +0000 Subject: [PATCH] capture osrfServerError responses git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1691 9efc2488-bf62-4759-914b-345cdb29e865 --- src/javascript/opensrf.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/javascript/opensrf.js b/src/javascript/opensrf.js index 8e67234..5675cbd 100644 --- a/src/javascript/opensrf.js +++ b/src/javascript/opensrf.js @@ -270,7 +270,7 @@ OpenSRF.Stack.handle_message = function(ses, osrf_msg, callbacks) { } } - if(status == OSRF_STATUS_NOTFOUND) { + if(status == OSRF_STATUS_NOTFOUND || status == OSRF_STATUS_INTERNALSERVERERROR) { req = ses.find_request(osrf_msg.threadTrace()); if(callbacks.onmethoderror) return callbacks.onmethoderror(req, status, status_text); @@ -398,6 +398,19 @@ osrfResult.prototype.content = function() { this.hash.content = d; return this.hash.content; } - +function osrfServerError(hash) { + this.hash = hash; + this._encodehash = true; +} +osrfServerError.prototype.status = function() { + if(arguments.length == 1) + this.hash.status = d; + return this.hash.status; +} +osrfServerError.prototype.statusCode = function() { + if(arguments.length == 1) + this.hash.statusCode = d; + return this.hash.statusCode; +} -- 2.11.0