Pman.Request.js
[Pman.Core] / Pman.Request.js
index 85387d0..4cb2ebd 100644 (file)
@@ -50,7 +50,11 @@ Roo.extend(Pman.Request, Roo.data.Connection, {
             }
             
         } catch(e) {
-            res = { success : false,  errorMsg : response.responseText, errors : true };
+            res = { success : false,  errorMsg : response.responseText || Roo.encode(response), errors : true };
+        }
+        //Roo.log(response.responseText);
+        if (!res.success && !res.errorMsg) {
+            res .errorMsg = Roo.encode(response);
         }
         return res;
     },
@@ -83,9 +87,12 @@ Roo.extend(Pman.Request, Roo.data.Connection, {
         response.argument = options ? options.argument : null;
         this.fireEvent("requestexception", this, response, options, e);
         var res = Roo.callback(options.failure, options.scope, [response, options]);
+        
         if (res !== true) {
+            var decode = this.processResponse(response);
+                
             Roo.MessageBox.hide(); // hide any existing messages..
-            Roo.MessageBox.alert("Error", "Error Sending" + res);
+            Roo.MessageBox.alert("Error", "Error Sending" + decode.errorMsg);
         }
     }
 });
\ No newline at end of file