Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
process: disable coloring fatal error stack trace
Fatal errors are logged from C++ directly to stderr.
If colored stack trace is used, ANSI color escape sequences
are literally included in the stack trace string. It works
in console on Unix-like systems, but does not work on
Windows or in inspector's DevTools. This PR disables colored
stack trace for fatal errors.
  • Loading branch information
Hakerh400 committed Jun 19, 2019
commit 920ee5c1ff83f7d1c0ebb9feaec9351a1d2faac6
5 changes: 1 addition & 4 deletions lib/internal/process/execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,6 @@ function createOnGlobalUncaughtException() {
// If someone handled it, then great. Otherwise, die in C++ land
// since that means that we'll exit the process, emit the 'exit' event.
const { inspect } = require('internal/util/inspect');
const colors = internalBinding('util').guessHandleType(2) === 'TTY' &&
require('internal/tty').hasColors() ||
inspect.defaultOptions.colors;
try {
if (!process._exiting) {
process._exiting = true;
Expand All @@ -167,7 +164,7 @@ function createOnGlobalUncaughtException() {
const { kExpandStackSymbol } = require('internal/util');
if (typeof er[kExpandStackSymbol] === 'function')
er[kExpandStackSymbol]();
er.stack = inspect(er, { colors });
er.stack = inspect(er);
} catch {
// Nothing to be done about it at this point.
}
Expand Down