Bug 803638 - introduce logException. r=davidb

This commit is contained in:
Eitan Isaacson 2012-10-19 13:39:36 -07:00
parent 71777c19cd
commit 912c7b70bc
3 changed files with 21 additions and 8 deletions

View File

@ -137,7 +137,7 @@ var AccessFu = {
else
this._disable();
} catch (x) {
Logger.error(x);
Logger.logException(x);
}
},
@ -157,7 +157,7 @@ var AccessFu = {
Output[presenter.type](presenter.details, aMessage.target);
}
} catch (x) {
Logger.error(x);
Logger.logException(x);
}
break;
case 'AccessFu:Input':
@ -341,7 +341,7 @@ var Input = {
break;
}
} catch (x) {
Logger.error(x);
Logger.logException(x);
}
},

View File

@ -42,7 +42,8 @@ var EventManager = {
}
);
} catch (x) {
Logger.error('Failed to start EventManager:', x);
Logger.error('Failed to start EventManager');
Logger.logException(x);
}
},
@ -94,7 +95,8 @@ var EventManager = {
}
}
} catch (x) {
Logger.error('Error handling DOM event:', x);
Logger.error('Error handling DOM event');
Logger.logException(x);
}
},
@ -106,7 +108,8 @@ var EventManager = {
event = aSubject.QueryInterface(Ci.nsIAccessibleEvent);
this.handleAccEvent(event);
} catch (x) {
Logger.error('Error handing accessible event:', x);
Logger.error('Error handing accessible event');
Logger.logException(x);
return;
}
}
@ -248,7 +251,7 @@ var EventManager = {
[aPresenterFunc(p) for each (p in this.presenters)].
filter(function(d) {return !!d;}));
} catch (x) {
Logger.error(x);
Logger.logException(x);
}
},

View File

@ -98,7 +98,7 @@ var Utils = {
return aBrowser.QueryInterface(Ci.nsIFrameLoaderOwner).
frameLoader.messageManager;
} catch (x) {
Logger.error(x);
Logger.logException(x);
return null;
}
},
@ -194,6 +194,16 @@ var Logger = {
this, [this.ERROR].concat(Array.prototype.slice.call(arguments)));
},
logException: function logException(aException) {
try {
this.error(
aException.message,
'(' + aException.fileName + ':' + aException.lineNumber + ')');
} catch (x) {
this.error(x);
}
},
accessibleToString: function accessibleToString(aAccessible) {
let str = '[ defunct ]';
try {