From 105465c7d419ea0862ae9b3b33ff9a9e492910ae Mon Sep 17 00:00:00 2001 From: Eitan Isaacson Date: Fri, 19 Oct 2012 13:39:36 -0700 Subject: [PATCH] Bug 803638 - introduce logException. r=davidb --- accessible/src/jsat/AccessFu.jsm | 6 +++--- accessible/src/jsat/EventManager.jsm | 11 +++++++---- accessible/src/jsat/Utils.jsm | 12 +++++++++++- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/accessible/src/jsat/AccessFu.jsm b/accessible/src/jsat/AccessFu.jsm index 1a623dbd03fe..764e5258e1e5 100644 --- a/accessible/src/jsat/AccessFu.jsm +++ b/accessible/src/jsat/AccessFu.jsm @@ -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); } }, diff --git a/accessible/src/jsat/EventManager.jsm b/accessible/src/jsat/EventManager.jsm index ae196c8cf6d5..113f5cfe9f27 100644 --- a/accessible/src/jsat/EventManager.jsm +++ b/accessible/src/jsat/EventManager.jsm @@ -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); } }, diff --git a/accessible/src/jsat/Utils.jsm b/accessible/src/jsat/Utils.jsm index 9d3b25d82d67..03c4cbfc3444 100644 --- a/accessible/src/jsat/Utils.jsm +++ b/accessible/src/jsat/Utils.jsm @@ -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 {