svn://svn.open-ils.org/ILS/trunk
........
r9513 | erickson | 2008-05-06 14:08:20 -0400 (Tue, 06 May 2008) | 1 line
added some more explicit error handling calls for easier debugging
........
git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9514
dcc99617-32d9-48b4-a31d-
7c20da2025e4
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);
}
}