pub fn fatal_report(msg: &str) -> StringExpand description
What node writes to stderr for the exception msg that is ending the
process — ReportFatalException (src/node_errors.cc), fed by
fatalExceptionStackEnhancers (lib/internal/errors.js):
- an object (an
Erroror anything else) prints the source arrow — thefile:lineheader, the source line and a^under the raise, then a blank line — followed byutil.inspect(err, { customInspect: false, depth: 5 }), which for an error is itsstackplus any own properties; - a primitive prints a blank line, the arrow, the value, and the
--trace-uncaughthint (AppendExceptionLinewrites the arrow itself for a non-error); - both end with a blank line and
Node.js <version>.
The arrow points where the exception was thrown, except for an unhandled
rejection, whose error has no throw site and is shown where it was created.
node colours the inspected error when stderr is a terminal; this runtime’s
util.inspect has no colours, so it never does.