staff web : net log errors
authorBill Erickson <berick@esilibrary.com>
Tue, 5 Nov 2013 16:08:03 +0000 (11:08 -0500)
committerBill Erickson <berick@esilibrary.com>
Tue, 5 Nov 2013 22:03:10 +0000 (17:03 -0500)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/web/js/ui/default/staff/services/net.js

index d499923..2acd0a0 100644 (file)
@@ -32,10 +32,11 @@ angular.module('egCoreMod')
         request : function(service, method) {
             var last;
             var deferred = $q.defer();
+            var params = Array.prototype.slice.call(arguments, 2);
             new OpenSRF.ClientSession(service).request({
                 async  : true,
                 method : method,
-                params : Array.prototype.slice.call(arguments, 2),
+                params : params,
                 oncomplete : function() {
                     deferred.resolve(last ? last.content() : null);
                 },
@@ -44,6 +45,12 @@ angular.module('egCoreMod')
                         deferred.notify(last.content());
                 },
                 onerror : function(msg) {
+                    // 'msg' currently tells us very little, so don't 
+                    // bother JSON-ifying it, since there is the off
+                    // chance that JSON-ification could fail, e.g if 
+                    // the object has circular refs.
+                    console.error(method + 
+                        ' (' + params + ')  failed.  See server logs.');
                     deferred.reject(msg);
                 }
             }).send();