Closed Bug 1599641 Opened 10 months ago Closed 10 months ago

Un-formatted stack traces for event-emitter errors in Browser Console

Categories

(DevTools :: General, defect, P2)

defect

Tracking

(firefox72 fixed)

RESOLVED FIXED
Firefox 72
Tracking Status
firefox72 --- fixed

People

(Reporter: Harald, Assigned: nchevobbe)

Details

Attachments

(1 file)

Saw this while looking at logs for bug 1599635. Seems mostly errors logged from console.error, which Console has been improving but still seems to struggle with even for Firefox code.

https://www.loom.com/share/81b676987d95419a8b25067a498768b2

This is because we are logging a string in devtools/shared/event-emitter.js#193-195 :

const msg = ex + ": " + ex.stack;
// For us it's a simple string here.
console.error(msg);

A simple fix, for us, would be to directly use ex, which should render a proper error in the console.

We have Bug 1046256 to parse those and render them as the other stacks (it might be perf sensitive though).

Component: Console → General
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED

We were logging a concatenated string of the
exception and its stack trace, which means
that it would show up in the console as a simple
string (i.e. without clickable links).
Logging the exception should make it more readable
in the browser console.

Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a9fe3f170934
Directly log an exception in event emitter. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 72
You need to log in before you can comment on or make changes to this bug.