Closed Bug 1179970 Opened 9 years ago Closed 9 years ago

Use Cu.reportError instead of console.error to report errors

Categories

(DevTools :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: julian.descottes, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36
Opening this bug after a discussion in Bug 968241 : https://bugzilla.mozilla.org/show_bug.cgi?id=968241#c67 The recommended way to log errors is to use Cu.reportError : - already used a lot in the devtools - console.error now needs to be bound to console when passed as a callback (Bug 989619) When creating this bug, Bugzilla suggested Bug 877389 as a duplicate. Bug 877389 actually suggests to prefer console.error to Cu.reportError. It was opened before console.error required a console.scope. We should either close Bug 877389 or close this bug. :pbro : What do you think ?
Component: Untriaged → Developer Tools
Flags: needinfo?(pbrosset)
Summary: Use Cu.reportError instead of console.error → Use Cu.reportError instead of console.error to report errors
Swamped at the moment, can't really investigate this. Transferring to Panos who will know better anyway.
Flags: needinfo?(pbrosset) → needinfo?(past)
Bug 877389 is about the entire Firefox frontend code, not just devtools, but I think it's the right direction. We are slowly working towards making both devtools and Firefox more webby and using XPCOM methods isn't going to get us there. Another case-specific argument against Cu.reportError is that it's not present in every embedding of devtools (e.g. Thunderbird, xulrunner-based apps, etc.), so we explicitly avoid it in debugger server code. I think this is a WONTFIX.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Flags: needinfo?(past)
Resolution: --- → WONTFIX
Ok thanks for the heads up :)
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.