}
Roo.extend(Pman.Request, Roo.data.Connection, {
-
+ // private
processResponse : function(response) {
+ // convert the Roo Connection response into JSON data.
var res = '';
try {
}
} 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;
},
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", res.errorMsg ? res.errorMsg : "Error Sending");
+ Roo.MessageBox.alert("Error", "Error Sending" + decode.errorMsg);
}
}
});
\ No newline at end of file