Closed
Bug 610810
Opened 14 years ago
Closed 14 years ago
Add file and line number information to ERROR and WARN messages in the console
Categories
(Toolkit :: Add-ons Manager, defect)
Toolkit
Add-ons Manager
Tracking
()
VERIFIED
FIXED
mozilla2.0b8
People
(Reporter: mossop, Assigned: mossop)
Details
Attachments
(1 file)
37.31 KB,
patch
|
robert.strong.bugs
:
review+
mossop
:
approval2.0+
|
Details | Diff | Splinter Review |
Going forward I'm anticipating that we'll start to see strange error messages that at first glance are had to explain (like bug 603248). One step we can take is to figure out the specific line that is throwing exceptions and include that in the log. This can help narrow things down a bit.
Assignee | ||
Comment 1•14 years ago
|
||
By passing excplicit extension objects through to the logging methods we can both log the exception and pull file and line number info from them. In their absence we can just use the stack to figure out where was calling the logging method. Also helped me spot a stupid error in the xpinstall/head.js file so that's a win right?
Attachment #489543 -
Flags: review?(robert.bugzilla)
Assignee | ||
Updated•14 years ago
|
Whiteboard: [has patch][needs review rs]
Comment 2•14 years ago
|
||
Comment on attachment 489543 [details] [diff] [review] patch rev 1 >diff --git a/toolkit/mozapps/extensions/AddonManager.jsm b/toolkit/mozapps/extensions/AddonManager.jsm >--- a/toolkit/mozapps/extensions/AddonManager.jsm >+++ b/toolkit/mozapps/extensions/AddonManager.jsm >@@ -76,17 +76,17 @@ const DEFAULT_PROVIDERS = [ > */ > function safeCall(aCallback) { > var args = Array.slice(arguments, 1); > > try { > aCallback.apply(null, args); > } > catch (e) { >- WARN("Exception calling callback: " + e); >+ WARN("Exception calling callback", e); > } > } > > /** > * Calls a method on a provider if it exists and consumes any thrown exception. > * Any parameters after the dflt parameter are passed to the provider's method. > * > * @param aProvider >@@ -102,18 +102,19 @@ function safeCall(aCallback) { > function callProvider(aProvider, aMethod, aDefault) { > if (!(aMethod in aProvider)) > return aDefault; > > var args = Array.slice(arguments, 3); > > try { > return aProvider[aMethod].apply(aProvider, args); >- } catch (e) { >- ERROR("Exception calling provider." + aMethod + ": " + e); >+ } >+ catch (e) { >+ ERROR("Exception calling provider." + aMethod, e); Should there be a space after the "." or should the "." be removed?
Attachment #489543 -
Flags: review?(robert.bugzilla) → review+
Assignee | ||
Comment 3•14 years ago
|
||
Comment on attachment 489543 [details] [diff] [review] patch rev 1 Straightforward risk-free patch that gives us better information for diagnosing problems in the future
Attachment #489543 -
Flags: approval2.0+
Assignee | ||
Comment 4•14 years ago
|
||
Landed http://hg.mozilla.org/mozilla-central/rev/56e0c37647b7
Status: NEW → RESOLVED
Closed: 14 years ago
Flags: in-testsuite-
Flags: in-litmus-
Resolution: --- → FIXED
Whiteboard: [has patch][needs review rs]
Target Milestone: --- → mozilla2.0b8
Assignee | ||
Comment 5•14 years ago
|
||
Backed out due to windows debug test failures
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 6•14 years ago
|
||
Re-landed as this wasn't the cause of the bustage: http://hg.mozilla.org/mozilla-central/rev/2a3cc3bffc66
Status: REOPENED → RESOLVED
Closed: 14 years ago → 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•