Closed
Bug 1263747
Opened 9 years ago
Closed 9 years ago
Console.jsm should log error messages when stringifying errors
Categories
(Toolkit :: General, defect)
Toolkit
General
Tracking
()
RESOLVED
FIXED
mozilla48
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: lina, Assigned: lina)
Details
Attachments
(1 file)
Console.jsm uses `JSON.stringify` when printing error objects via `dump`. Unfortunately, this makes the error a bit vague: for example, https://treeherder.mozilla.org/logviewer.html#?job_id=19148268&repo=try#L4186.
It would help if we could log the error name and message in this case. I think it's fine to omit the stack, since that could take up multiple lines and introduce noise.
Assignee | ||
Comment 1•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/45587/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/45587/
Attachment #8740148 -
Flags: review?(bgrinstead)
Updated•9 years ago
|
Attachment #8740148 -
Flags: review?(bgrinstead) → review+
Comment 2•9 years ago
|
||
Comment on attachment 8740148 [details]
MozReview Request: Bug 1263747 - Log error messages when stringifying errors. r?bgrins
https://reviewboard.mozilla.org/r/45587/#review42133
nice
::: toolkit/modules/Console.jsm:117
(Diff revision 1)
> + The object to check
> + * @return {boolean}
> + Is this object an error?
> + */
> +function isError(aThing) {
> + return (typeof aThing.name == "string" &&
Think it'd be safest to include `if (typeof aThing == "object")` in this chain so we don't have to assume it's already been null checked
Assignee | ||
Comment 4•9 years ago
|
||
Comment 5•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in
before you can comment on or make changes to this bug.
Description
•