Closed
Bug 869372
Opened 11 years ago
Closed 11 years ago
Don't silence unknown errors in promises
Categories
(L20n :: JS Library, defect, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
1.0
People
(Reporter: stas, Assigned: stas)
Details
Attachments
(1 file, 2 obsolete files)
2.19 KB,
patch
|
zbraniecki
:
review+
|
Details | Diff | Splinter Review |
When we're in async mode (the first locale isn't built yet), the translations listening to 'ready' and those registered via ctx.localize may return an unknown error but it will be silent, making debugging hard. This is because freeze() uses a Promise with no errback.
Assignee | ||
Comment 1•11 years ago
|
||
Assignee: nobody → stas
Attachment #746325 -
Flags: review?(gandalf)
Assignee | ||
Updated•11 years ago
|
Priority: -- → P3
Target Milestone: --- → 1.0
Comment 2•11 years ago
|
||
Comment on attachment 746325 [details] [diff] [review] Pass an errback to then() I'm not sure if context.js should refer console.* object. I don't know how widespread console.* is but I don't believe it to be part of DOM standard. Should we define it in bindings?
Assignee | ||
Comment 3•11 years ago
|
||
You're right, it's not. It's defined in most browsers (IE9+) and in node.js, but for instance XPCShell doesn't define it; it has `dump` instead. Can we define it in the postfix files which are appended to the dist file? An alternative would be to emit the error, not console.log it.
Comment 4•11 years ago
|
||
I'd prefer emitting it I believe.
Assignee | ||
Comment 5•11 years ago
|
||
I like emitting too. We can listen to these events and console.(log|warn|error) them in the bindings. In this patch I propose that we emit known and safe context errors as 'error' events, and unknown JS-related, possibly fatal errors as 'debug'. We can discuss this and clean it up in bug 802850. If someone wants to do something else with the event, we should let them do so. Right now it's hard bacause document.l10n isn't immediately available, see bug 882601.
Attachment #746325 -
Attachment is obsolete: true
Attachment #746325 -
Flags: review?(gandalf)
Attachment #761927 -
Flags: review?(gandalf)
Assignee | ||
Comment 6•11 years ago
|
||
Oops, I forgot about gaia.js.
Attachment #761927 -
Attachment is obsolete: true
Attachment #761927 -
Flags: review?(gandalf)
Attachment #761930 -
Flags: review?(gandalf)
Updated•11 years ago
|
Attachment #761930 -
Flags: review?(gandalf) → review+
Assignee | ||
Comment 7•11 years ago
|
||
https://github.com/l20n/l20n.js/commit/2f54c63d299dc6cdb801b20fc733ca3584fd4ecf
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•