[Opensrf-commits] r1691 - trunk/src/javascript (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Apr 2 15:59:53 EDT 2009


Author: erickson
Date: 2009-04-02 15:59:49 -0400 (Thu, 02 Apr 2009)
New Revision: 1691

Modified:
   trunk/src/javascript/opensrf.js
Log:
capture osrfServerError responses

Modified: trunk/src/javascript/opensrf.js
===================================================================
--- trunk/src/javascript/opensrf.js	2009-03-31 18:34:48 UTC (rev 1690)
+++ trunk/src/javascript/opensrf.js	2009-04-02 19:59:49 UTC (rev 1691)
@@ -270,7 +270,7 @@
             }
         }
 
-        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 @@
         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; 
+}
 
 
-



More information about the opensrf-commits mailing list