give readresponse the knowledge to look for failure events within a list result
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 23 Nov 2008 16:22:41 +0000 (16:22 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 23 Nov 2008 16:22:41 +0000 (16:22 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@11311 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/Util.js

index 83ec5af..1e6c384 100644 (file)
@@ -104,11 +104,14 @@ if(!dojo._hasResource["openils.Util"]) {
      * false, the response content will be null when an event is encountered.
      */
     openils.Util.alertEvent = true;
-    openils.Util.readResponse = function(r, eventOk) {
+    openils.Util.readResponse = function(r, eventOk, isList) {
         var msg = r.recv();
         if(msg == null) return msg;
         var val = msg.content();
-        if(e = openils.Event.parse(val)) {
+        var testval = val;
+        if(isList && dojo.isArray(val))
+            testval = val[0];
+        if(e = openils.Event.parse(testval)) {
             if(eventOk) return e;
             console.log(e.toString());
             if(openils.Util.alertEvent)