added some more explicit error handling calls for easier debugging
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 6 May 2008 18:08:20 +0000 (18:08 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 6 May 2008 18:08:20 +0000 (18:08 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@9513 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/fieldmapper/Fieldmapper.js

index 093fca2..776b5db 100644 (file)
@@ -99,9 +99,21 @@ if(!dojo._hasResource["fieldmapper.Fieldmapper"]){
 
         if (!args.async && !args.timeout) args.timeout = 10;
 
+        if(!args.onmethoderror) {
+            args.onmethoderror = function(r, stat, stat_text) {
+                throw new Error('Method error: ' + r.stat + ' : ' + stat_text);
+            }
+        }
+
+        if(!args.ontransporterror) {
+            args.ontransporterror = function(xreq) {
+                throw new Error('Transport error status=' + xreq.status);
+            }
+        }
+
                if (!args.onerror) {
                        args.onerror = function (r) {
-                               throw 'Error encountered! ' + r;
+                               throw new Error('Request error encountered! ' + r);
                        }
                }