Skip to content

Commit

Permalink
Be more tolerant of missing err.stack in parse-stack.js.
Browse files Browse the repository at this point in the history
Should help with #10083.
  • Loading branch information
Ben Newman committed Oct 3, 2018
1 parent c3309b1 commit 8f8e2a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/utils/parse-stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ const _ = require('underscore');
// return anything past that function. We call this the "user portion"
// of the stack.
export function parse(err) {
const stack = err.stack;
if (typeof stack !== "string") {
return {};
}

// at least the first line is the exception
const frames = err.stack.split("\n").slice(1)
const frames = stack.split("\n").slice(1)
// longjohn adds lines of the form '---' (45 times) to separate
// the trace across async boundaries. It's not clear if we need to
// separate the trace in the same way we do for future boundaries below
Expand Down

0 comments on commit 8f8e2a0

Please sign in to comment.