Permalink
Browse files

Improve error handling

  • Loading branch information...
1 parent 67ba8f1 commit 4278fa798c0e9eaf5ce0cf6387c1190c93e1a2cc @james-emerton james-emerton committed Jan 4, 2012
Showing with 5 additions and 4 deletions.
  1. +2 −2 lib/DAV/handler.js
  2. +3 −2 lib/DAV/util.js
View
4 lib/DAV/handler.js
@@ -263,8 +263,8 @@ exports.NS_AJAXORG = "http://ajax.org/2005/aml";
* @return {void}
*/
this.handleError = function(e) {
- //if (jsDAV.debugMode)
- // console.trace();
+ if (jsDAV.debugMode)
+ console.log(e.stack || (new Error()).stack);
if (e === true)
return; // plugins should return TRUE to prevent error reporting.
if (typeof e == "string")
View
5 lib/DAV/util.js
@@ -959,8 +959,9 @@ exports.EventEmitter.PRIO_HIGH = 0x0004;
try {
listener.apply(null, [e].concat(args));
}
- catch(e) {
- return cbdispatch(e);
+ catch(err) {
+ e.$done = true;
+ return cbdispatch(err);
}
if (listener.$usetimeout > 0) {

0 comments on commit 4278fa7

Please sign in to comment.