Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDivlo <contact@divlo.fr>2021-09-02 02:59:45 +0300
committerMichael Dawson <mdawson@devrus.com>2021-09-08 20:31:07 +0300
commit59d3d542d69f078cd1d9f50f26b83944c381724e (patch)
tree418aefbd529e5f7261626a3bc1d480d161c35756
parent33b5107d13f3b5b01861ac7deb4253cfc3d84fc5 (diff)
errors: disp ver on fatal except that causes exit
Display Node.js version at the end of stacktraces on fatal exception that causes exit. Easier for debugging so you don't have to ask "what node version are you on?", it is directly in the error the user copy/paste from when asking for help. Fixes: https://github.com/nodejs/node/issues/29731 PR-URL: https://github.com/nodejs/node/pull/38332 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
-rw-r--r--doc/api/cli.md8
-rw-r--r--doc/node.13
-rw-r--r--src/node_errors.cc4
-rw-r--r--src/node_options.cc5
-rw-r--r--src/node_options.h1
-rw-r--r--test/message/assert_throws_stack.out2
-rw-r--r--test/message/core_line_numbers.out2
-rw-r--r--test/message/error_aggregateTwoErrors.out2
-rw-r--r--test/message/error_exit.out2
-rw-r--r--test/message/error_with_nul.outbin561 -> 572 bytes
-rw-r--r--test/message/esm_display_syntax_error.out2
-rw-r--r--test/message/esm_display_syntax_error_import.out2
-rw-r--r--test/message/esm_display_syntax_error_import_module.out2
-rw-r--r--test/message/esm_display_syntax_error_module.out2
-rw-r--r--test/message/esm_loader_not_found.out2
-rw-r--r--test/message/esm_loader_not_found_cjs_hint_bare.out2
-rw-r--r--test/message/esm_loader_not_found_cjs_hint_relative.out2
-rw-r--r--test/message/esm_loader_syntax_error.out2
-rw-r--r--test/message/eval_messages.out12
-rw-r--r--test/message/events_unhandled_error_common_trace.out2
-rw-r--r--test/message/events_unhandled_error_nexttick.out2
-rw-r--r--test/message/events_unhandled_error_sameline.out2
-rw-r--r--test/message/events_unhandled_error_subclass.out2
-rw-r--r--test/message/if-error-has-good-stack.out2
-rw-r--r--test/message/internal_assert.out2
-rw-r--r--test/message/internal_assert_fail.out2
-rw-r--r--test/message/nexttick_throw.out2
-rw-r--r--test/message/promise_always_throw_unhandled.out2
-rw-r--r--test/message/source_map_disabled_by_api.out2
-rw-r--r--test/message/source_map_enabled_by_api.out2
-rw-r--r--test/message/source_map_enclosing_function.out2
-rw-r--r--test/message/source_map_reference_error_tabs.out2
-rw-r--r--test/message/source_map_throw_first_tick.out2
-rw-r--r--test/message/source_map_throw_icu.out2
-rw-r--r--test/message/source_map_throw_set_immediate.out2
-rw-r--r--test/message/stack_overflow.out2
-rw-r--r--test/message/stdin_messages.out12
-rw-r--r--test/message/test-no-extra-info-on-fatal-exception.js6
-rw-r--r--test/message/test-no-extra-info-on-fatal-exception.out12
-rw-r--r--test/message/throw_custom_error.out2
-rw-r--r--test/message/throw_error_with_getter_throw.out2
-rw-r--r--test/message/throw_error_with_getter_throw_traced.out2
-rw-r--r--test/message/throw_in_line_with_tabs.out2
-rw-r--r--test/message/throw_non_error.out2
-rw-r--r--test/message/throw_null.out2
-rw-r--r--test/message/throw_null_traced.out2
-rw-r--r--test/message/throw_undefined.out2
-rw-r--r--test/message/throw_undefined_traced.out2
-rw-r--r--test/message/timeout_throw.out2
-rw-r--r--test/message/undefined_reference_in_new_context.out2
-rw-r--r--test/message/vm_display_runtime_error.out2
-rw-r--r--test/message/vm_display_syntax_error.out2
-rw-r--r--test/message/vm_dont_display_runtime_error.out2
-rw-r--r--test/message/vm_dont_display_syntax_error.out2
-rw-r--r--test/parallel/test-cli-node-options.js1
-rw-r--r--test/parallel/test-error-reporting.js3
-rw-r--r--test/pseudo-tty/test-fatal-error.out2
57 files changed, 155 insertions, 2 deletions
diff --git a/doc/api/cli.md b/doc/api/cli.md
index 48bfd090f65..f87b2476e0f 100644
--- a/doc/api/cli.md
+++ b/doc/api/cli.md
@@ -605,6 +605,13 @@ added: v0.8.0
Silence deprecation warnings.
+### `--no-extra-info-on-fatal-exception`
+<!-- YAML
+added: REPLACEME
+-->
+
+Hide extra information on fatal exception that causes exit.
+
### `--no-force-async-hooks-checks`
<!-- YAML
added: v9.0.0
@@ -1423,6 +1430,7 @@ Node.js options that are allowed are:
* `--napi-modules`
* `--no-deprecation`
* `--no-experimental-repl-await`
+* `--no-extra-info-on-fatal-exception`
* `--no-force-async-hooks-checks`
* `--no-warnings`
* `--node-memory-debug`
diff --git a/doc/node.1 b/doc/node.1
index 29861a7fab4..310de73b89d 100644
--- a/doc/node.1
+++ b/doc/node.1
@@ -273,6 +273,9 @@ It is kept for compatibility.
.It Fl -no-deprecation
Silence deprecation warnings.
.
+.It Fl -no-extra-info-on-fatal-exception
+Hide extra information on fatal exception that causes exit.
+.
.It Fl -no-force-async-hooks-checks
Disable runtime checks for `async_hooks`.
These will still be enabled dynamically when `async_hooks` is enabled.
diff --git a/src/node_errors.cc b/src/node_errors.cc
index 0e4ba26e1bc..91f69ef43f2 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -414,6 +414,10 @@ static void ReportFatalException(Environment* env,
}
}
+ if (env->options()->extra_info_on_fatal_exception) {
+ FPrintF(stderr, "\nNode.js %s\n", NODE_VERSION);
+ }
+
fflush(stderr);
}
diff --git a/src/node_options.cc b/src/node_options.cc
index 40f8cf86902..f66fbc8ed45 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -511,6 +511,11 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
"show stack traces on process warnings",
&EnvironmentOptions::trace_warnings,
kAllowedInEnvironment);
+ AddOption("--extra-info-on-fatal-exception",
+ "hide extra information on fatal exception that causes exit",
+ &EnvironmentOptions::extra_info_on_fatal_exception,
+ kAllowedInEnvironment,
+ true);
AddOption("--unhandled-rejections",
"define unhandled rejections behavior. Options are 'strict' "
"(always raise an error), 'throw' (raise an error unless "
diff --git a/src/node_options.h b/src/node_options.h
index a751d787d7f..36b5ed40197 100644
--- a/src/node_options.h
+++ b/src/node_options.h
@@ -150,6 +150,7 @@ class EnvironmentOptions : public Options {
bool trace_tls = false;
bool trace_uncaught = false;
bool trace_warnings = false;
+ bool extra_info_on_fatal_exception = true;
std::string unhandled_rejections;
std::string userland_loader;
bool verify_base_objects =
diff --git a/test/message/assert_throws_stack.out b/test/message/assert_throws_stack.out
index 6841630d03b..06eaa906442 100644
--- a/test/message/assert_throws_stack.out
+++ b/test/message/assert_throws_stack.out
@@ -32,3 +32,5 @@ AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
expected: { bar: true },
operator: 'throws'
}
+
+Node.js *
diff --git a/test/message/core_line_numbers.out b/test/message/core_line_numbers.out
index 97b017f66e2..54b3b0ac2dc 100644
--- a/test/message/core_line_numbers.out
+++ b/test/message/core_line_numbers.out
@@ -12,3 +12,5 @@ RangeError: Invalid input
at Function.Module._load (node:internal/modules/cjs/loader:*:*)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*:*)
at node:internal/main/run_main_module:*:*
+
+Node.js *
diff --git a/test/message/error_aggregateTwoErrors.out b/test/message/error_aggregateTwoErrors.out
index d1dc13eacc3..fef3953451e 100644
--- a/test/message/error_aggregateTwoErrors.out
+++ b/test/message/error_aggregateTwoErrors.out
@@ -11,3 +11,5 @@ AggregateError: original
at node:internal/main/run_main_module:*:* {
code: 'ERR0'
}
+
+Node.js *
diff --git a/test/message/error_exit.out b/test/message/error_exit.out
index 2ef95b535da..da535b05c10 100644
--- a/test/message/error_exit.out
+++ b/test/message/error_exit.out
@@ -20,3 +20,5 @@ AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
expected: 2,
operator: 'strictEqual'
}
+
+Node.js *
diff --git a/test/message/error_with_nul.out b/test/message/error_with_nul.out
index 7fbb33f08e8..4d3172439a9 100644
--- a/test/message/error_with_nul.out
+++ b/test/message/error_with_nul.out
Binary files differ
diff --git a/test/message/esm_display_syntax_error.out b/test/message/esm_display_syntax_error.out
index f1b7ff4e229..1f8e3861c43 100644
--- a/test/message/esm_display_syntax_error.out
+++ b/test/message/esm_display_syntax_error.out
@@ -5,3 +5,5 @@ await async () => 0;
SyntaxError: Unexpected reserved word
at Loader.moduleStrategy (node:internal/modules/esm/translators:*:*)
at async link (node:internal/modules/esm/module_job:*:*)
+
+Node.js *
diff --git a/test/message/esm_display_syntax_error_import.out b/test/message/esm_display_syntax_error_import.out
index ad906af431b..16282c009ee 100644
--- a/test/message/esm_display_syntax_error_import.out
+++ b/test/message/esm_display_syntax_error_import.out
@@ -7,3 +7,5 @@ SyntaxError: The requested module '../fixtures/es-module-loaders/module-named-ex
at async Loader.import (node:internal/modules/esm/loader:*:*)
at async Object.loadESM (node:internal/process/esm_loader:*:*)
at async handleMainPromise (node:internal/modules/run_main:*:*)
+
+Node.js *
diff --git a/test/message/esm_display_syntax_error_import_module.out b/test/message/esm_display_syntax_error_import_module.out
index 60a208d534a..2e788994016 100644
--- a/test/message/esm_display_syntax_error_import_module.out
+++ b/test/message/esm_display_syntax_error_import_module.out
@@ -7,3 +7,5 @@ SyntaxError: The requested module './module-named-exports.mjs' does not provide
at async Loader.import (node:internal/modules/esm/loader:*:*)
at async Object.loadESM (node:internal/process/esm_loader:*:*)
at async handleMainPromise (node:internal/modules/run_main:*:*)
+
+Node.js *
diff --git a/test/message/esm_display_syntax_error_module.out b/test/message/esm_display_syntax_error_module.out
index fc0912a96c0..48dcbb54647 100644
--- a/test/message/esm_display_syntax_error_module.out
+++ b/test/message/esm_display_syntax_error_module.out
@@ -4,3 +4,5 @@ await async () => 0;
SyntaxError: Malformed arrow function parameter list
at Loader.moduleStrategy (node:internal/modules/esm/translators:*:*)
+
+Node.js *
diff --git a/test/message/esm_loader_not_found.out b/test/message/esm_loader_not_found.out
index 61b1623cdf1..660e02ee330 100644
--- a/test/message/esm_loader_not_found.out
+++ b/test/message/esm_loader_not_found.out
@@ -16,3 +16,5 @@ Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'i-dont-exist' imported from *
at Object.loadESM (node:internal/process/esm_loader:*:*) {
code: 'ERR_MODULE_NOT_FOUND'
}
+
+Node.js *
diff --git a/test/message/esm_loader_not_found_cjs_hint_bare.out b/test/message/esm_loader_not_found_cjs_hint_bare.out
index aaeed40ed60..07d708db32d 100644
--- a/test/message/esm_loader_not_found_cjs_hint_bare.out
+++ b/test/message/esm_loader_not_found_cjs_hint_bare.out
@@ -14,3 +14,5 @@ Did you mean to import some_module/obj.js?
at link (node:internal/modules/esm/module_job:*:*) {
code: 'ERR_MODULE_NOT_FOUND'
}
+
+Node.js *
diff --git a/test/message/esm_loader_not_found_cjs_hint_relative.out b/test/message/esm_loader_not_found_cjs_hint_relative.out
index 89b8d56133c..2a197417828 100644
--- a/test/message/esm_loader_not_found_cjs_hint_relative.out
+++ b/test/message/esm_loader_not_found_cjs_hint_relative.out
@@ -18,3 +18,5 @@ Did you mean to import ./test/common/fixtures.js?
at Object.loadESM (node:internal/process/esm_loader:*:*) {
code: 'ERR_MODULE_NOT_FOUND'
}
+
+Node.js *
diff --git a/test/message/esm_loader_syntax_error.out b/test/message/esm_loader_syntax_error.out
index de6014add66..bfaa8588f73 100644
--- a/test/message/esm_loader_syntax_error.out
+++ b/test/message/esm_loader_syntax_error.out
@@ -7,3 +7,5 @@ await async () => 0;
SyntaxError: Malformed arrow function parameter list
at Loader.moduleStrategy (node:internal/modules/esm/translators:*:*)
at async link (node:internal/modules/esm/module_job:*:*)
+
+Node.js *
diff --git a/test/message/eval_messages.out b/test/message/eval_messages.out
index 55efb879310..d34869586cf 100644
--- a/test/message/eval_messages.out
+++ b/test/message/eval_messages.out
@@ -10,6 +10,8 @@ SyntaxError: Strict mode code may not include a with statement
at [eval]-wrapper:*:*
at evalScript (node:internal/process/execution:*:*)
at node:internal/main/eval_string:*:*
+
+Node.js *
42
42
[eval]:1
@@ -25,6 +27,8 @@ Error: hello
at evalScript (node:internal/process/execution:*:*)
at node:internal/main/eval_string:*:*
+Node.js *
+
[eval]:1
throw new Error("hello")
^
@@ -37,6 +41,8 @@ Error: hello
at [eval]-wrapper:*:*
at evalScript (node:internal/process/execution:*:*)
at node:internal/main/eval_string:*:*
+
+Node.js *
100
[eval]:1
var x = 100; y = x;
@@ -51,15 +57,21 @@ ReferenceError: y is not defined
at evalScript (node:internal/process/execution:*:*)
at node:internal/main/eval_string:*:*
+Node.js *
+
[eval]:1
var ______________________________________________; throw 10
^
10
(Use `* --trace-uncaught ...` to show where the exception was thrown)
+Node.js *
+
[eval]:1
var ______________________________________________; throw 10
^
10
(Use `* --trace-uncaught ...` to show where the exception was thrown)
+
+Node.js *
done
diff --git a/test/message/events_unhandled_error_common_trace.out b/test/message/events_unhandled_error_common_trace.out
index 19e89869ba7..0c10dd53fa2 100644
--- a/test/message/events_unhandled_error_common_trace.out
+++ b/test/message/events_unhandled_error_common_trace.out
@@ -18,3 +18,5 @@ Emitted 'error' event at:
at Module._compile (node:internal/modules/cjs/loader:*:*)
[... lines matching original stack trace ...]
at node:internal/main/run_main_module:*:*
+
+Node.js *
diff --git a/test/message/events_unhandled_error_nexttick.out b/test/message/events_unhandled_error_nexttick.out
index 3e0d4697504..533b3ae463e 100644
--- a/test/message/events_unhandled_error_nexttick.out
+++ b/test/message/events_unhandled_error_nexttick.out
@@ -13,3 +13,5 @@ Error
Emitted 'error' event at:
at *events_unhandled_error_nexttick.js:*:*
at processTicksAndRejections (node:internal/process/task_queues:*:*)
+
+Node.js *
diff --git a/test/message/events_unhandled_error_sameline.out b/test/message/events_unhandled_error_sameline.out
index c0272750339..62feb784663 100644
--- a/test/message/events_unhandled_error_sameline.out
+++ b/test/message/events_unhandled_error_sameline.out
@@ -15,3 +15,5 @@ Emitted 'error' event at:
at Module._compile (node:internal/modules/cjs/loader:*:*)
[... lines matching original stack trace ...]
at node:internal/main/run_main_module:*:*
+
+Node.js *
diff --git a/test/message/events_unhandled_error_subclass.out b/test/message/events_unhandled_error_subclass.out
index 5b8131970d5..4eddce9baf9 100644
--- a/test/message/events_unhandled_error_subclass.out
+++ b/test/message/events_unhandled_error_subclass.out
@@ -15,3 +15,5 @@ Emitted 'error' event on Foo instance at:
at Module._compile (node:internal/modules/cjs/loader:*:*)
[... lines matching original stack trace ...]
at node:internal/main/run_main_module:*:*
+
+Node.js *
diff --git a/test/message/if-error-has-good-stack.out b/test/message/if-error-has-good-stack.out
index d87581cd767..32ec6de3e59 100644
--- a/test/message/if-error-has-good-stack.out
+++ b/test/message/if-error-has-good-stack.out
@@ -33,3 +33,5 @@ AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error
expected: null,
operator: 'ifError'
}
+
+Node.js *
diff --git a/test/message/internal_assert.out b/test/message/internal_assert.out
index 131eb658485..bd25c879478 100644
--- a/test/message/internal_assert.out
+++ b/test/message/internal_assert.out
@@ -16,3 +16,5 @@ Please open an issue with this stack trace at https://github.com/nodejs/node/iss
at * {
code: 'ERR_INTERNAL_ASSERTION'
}
+
+Node.js *
diff --git a/test/message/internal_assert_fail.out b/test/message/internal_assert_fail.out
index f3e2446ab14..408d6d33644 100644
--- a/test/message/internal_assert_fail.out
+++ b/test/message/internal_assert_fail.out
@@ -17,3 +17,5 @@ Please open an issue with this stack trace at https://github.com/nodejs/node/iss
at * {
code: 'ERR_INTERNAL_ASSERTION'
}
+
+Node.js *
diff --git a/test/message/nexttick_throw.out b/test/message/nexttick_throw.out
index 955bcda6a26..4efaed978a5 100644
--- a/test/message/nexttick_throw.out
+++ b/test/message/nexttick_throw.out
@@ -5,3 +5,5 @@
ReferenceError: undefined_reference_error_maker is not defined
at *test*message*nexttick_throw.js:*:*
at processTicksAndRejections (node:internal/process/task_queues:*:*)
+
+Node.js *
diff --git a/test/message/promise_always_throw_unhandled.out b/test/message/promise_always_throw_unhandled.out
index 8d030268565..bc2949391c1 100644
--- a/test/message/promise_always_throw_unhandled.out
+++ b/test/message/promise_always_throw_unhandled.out
@@ -11,3 +11,5 @@ Error: One
at *
at *
at *
+
+Node.js *
diff --git a/test/message/source_map_disabled_by_api.out b/test/message/source_map_disabled_by_api.out
index d2cca7da529..1b8d3d7a2e0 100644
--- a/test/message/source_map_disabled_by_api.out
+++ b/test/message/source_map_disabled_by_api.out
@@ -24,3 +24,5 @@ Error: an error!
at Module.load (node:internal/modules/cjs/loader:*)
at Function.Module._load (node:internal/modules/cjs/loader:*)
at Module.require (node:internal/modules/cjs/loader:*)
+
+Node.js *
diff --git a/test/message/source_map_enabled_by_api.out b/test/message/source_map_enabled_by_api.out
index 525ceccec12..2f902e90371 100644
--- a/test/message/source_map_enabled_by_api.out
+++ b/test/message/source_map_enabled_by_api.out
@@ -28,3 +28,5 @@ Error: an error!
at Module.load (node:internal/modules/cjs/loader:*)
at Function.Module._load (node:internal/modules/cjs/loader:*)
at Module.require (node:internal/modules/cjs/loader:*)
+
+Node.js *
diff --git a/test/message/source_map_enclosing_function.out b/test/message/source_map_enclosing_function.out
index 3eb76ecbbef..50e8e553494 100644
--- a/test/message/source_map_enclosing_function.out
+++ b/test/message/source_map_enclosing_function.out
@@ -13,3 +13,5 @@ Error: an error!
at Module.load (node:internal/modules/cjs/loader:*)
at Function.Module._load (node:internal/modules/cjs/loader:*)
at Module.require (node:internal/modules/cjs/loader:*)
+
+Node.js *
diff --git a/test/message/source_map_reference_error_tabs.out b/test/message/source_map_reference_error_tabs.out
index bce1b5f8911..9dfcf846372 100644
--- a/test/message/source_map_reference_error_tabs.out
+++ b/test/message/source_map_reference_error_tabs.out
@@ -13,3 +13,5 @@ ReferenceError: alert is not defined
at require (node:internal/modules/cjs/helpers:*
at Object.<anonymous> (*source_map_reference_error_tabs.js:*
at Module._compile (node:internal/modules/cjs/loader:*
+
+Node.js *
diff --git a/test/message/source_map_throw_first_tick.out b/test/message/source_map_throw_first_tick.out
index efa97a1d9f5..c4eb64aa8e3 100644
--- a/test/message/source_map_throw_first_tick.out
+++ b/test/message/source_map_throw_first_tick.out
@@ -13,3 +13,5 @@ Error: an exception
at require (node:internal/modules/cjs/helpers:*)
at Object.<anonymous> (*source_map_throw_first_tick.js:5:1)
at Module._compile (node:internal/modules/cjs/loader:*)
+
+Node.js *
diff --git a/test/message/source_map_throw_icu.out b/test/message/source_map_throw_icu.out
index 78482d73ddf..0e95691a23d 100644
--- a/test/message/source_map_throw_icu.out
+++ b/test/message/source_map_throw_icu.out
@@ -13,3 +13,5 @@ Error: an error
at require (node:internal/modules/cjs/helpers:*
at Object.<anonymous> (*source_map_throw_icu.js:*
at Module._compile (node:internal/modules/cjs/loader:*
+
+Node.js *
diff --git a/test/message/source_map_throw_set_immediate.out b/test/message/source_map_throw_set_immediate.out
index c735e23cb95..42a595c302e 100644
--- a/test/message/source_map_throw_set_immediate.out
+++ b/test/message/source_map_throw_set_immediate.out
@@ -6,3 +6,5 @@ Error: goodbye
at Hello *uglify-throw-original.js:5:9*
at *uglify-throw-original.js:9:3*
at processImmediate (node:internal/timers:*)
+
+Node.js *
diff --git a/test/message/stack_overflow.out b/test/message/stack_overflow.out
index d7a2c3eef06..fb378994672 100644
--- a/test/message/stack_overflow.out
+++ b/test/message/stack_overflow.out
@@ -4,3 +4,5 @@ JSON.stringify(array);
^
[RangeError: Maximum call stack size exceeded]
+
+Node.js *
diff --git a/test/message/stdin_messages.out b/test/message/stdin_messages.out
index 3ce4ba0c5b6..eb150d8eaf3 100644
--- a/test/message/stdin_messages.out
+++ b/test/message/stdin_messages.out
@@ -14,6 +14,8 @@ SyntaxError: Strict mode code may not include a with statement
at Socket.<anonymous> (node:internal/process/execution:*:*)
at Socket.emit (node:events:*:*)
at endReadableNT (node:internal/streams/readable:*:*)
+
+Node.js *
42
42
[stdin]:1
@@ -31,6 +33,8 @@ Error: hello
at Socket.<anonymous> (node:internal/process/execution:*:*)
at Socket.emit (node:events:*:*)
at endReadableNT (node:internal/streams/readable:*:*)
+
+Node.js *
[stdin]:1
throw new Error("hello")
^
@@ -46,6 +50,8 @@ Error: hello
at Socket.<anonymous> (node:internal/process/execution:*:*)
at Socket.emit (node:events:*:*)
at endReadableNT (node:internal/streams/readable:*:*)
+
+Node.js *
100
[stdin]:1
let x = 100; y = x;
@@ -63,15 +69,21 @@ ReferenceError: y is not defined
at Socket.emit (node:events:*:*)
at endReadableNT (node:internal/streams/readable:*:*)
+Node.js *
+
[stdin]:1
let ______________________________________________; throw 10
^
10
(Use `* --trace-uncaught ...` to show where the exception was thrown)
+Node.js *
+
[stdin]:1
let ______________________________________________; throw 10
^
10
(Use `* --trace-uncaught ...` to show where the exception was thrown)
+
+Node.js *
done
diff --git a/test/message/test-no-extra-info-on-fatal-exception.js b/test/message/test-no-extra-info-on-fatal-exception.js
new file mode 100644
index 00000000000..948274d2bb5
--- /dev/null
+++ b/test/message/test-no-extra-info-on-fatal-exception.js
@@ -0,0 +1,6 @@
+// Flags: --no-extra-info-on-fatal-exception
+
+'use strict';
+require('../common');
+
+throw new Error('foo');
diff --git a/test/message/test-no-extra-info-on-fatal-exception.out b/test/message/test-no-extra-info-on-fatal-exception.out
new file mode 100644
index 00000000000..840ee0e65a7
--- /dev/null
+++ b/test/message/test-no-extra-info-on-fatal-exception.out
@@ -0,0 +1,12 @@
+*:6
+throw new Error('foo');
+^
+
+Error: foo
+ at Object.<anonymous> (*:6:7)
+ at Module._compile (node:internal/modules/cjs/loader:*:*)
+ at Object.Module._extensions..js (node:internal/modules/cjs/loader:*:*)
+ at Module.load (node:internal/modules/cjs/loader:*:*)
+ at Function.Module._load (node:internal/modules/cjs/loader:*:*)
+ at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*:*)
+ at node:internal/main/run_main_module:*:*
diff --git a/test/message/throw_custom_error.out b/test/message/throw_custom_error.out
index a1fa8c6c5b7..920cbf62310 100644
--- a/test/message/throw_custom_error.out
+++ b/test/message/throw_custom_error.out
@@ -2,3 +2,5 @@
throw ({ name: 'MyCustomError', message: 'This is a custom message' });
^
{ name: 'MyCustomError', message: 'This is a custom message' }
+
+Node.js *
diff --git a/test/message/throw_error_with_getter_throw.out b/test/message/throw_error_with_getter_throw.out
index 2162185e784..565acfe9e6b 100644
--- a/test/message/throw_error_with_getter_throw.out
+++ b/test/message/throw_error_with_getter_throw.out
@@ -4,3 +4,5 @@ throw { // eslint-disable-line no-throw-literal
^
[object Object]
(Use `* --trace-uncaught ...` to show where the exception was thrown)
+
+Node.js *
diff --git a/test/message/throw_error_with_getter_throw_traced.out b/test/message/throw_error_with_getter_throw_traced.out
index f5106b8c3fc..87310042ad2 100644
--- a/test/message/throw_error_with_getter_throw_traced.out
+++ b/test/message/throw_error_with_getter_throw_traced.out
@@ -11,3 +11,5 @@ Thrown at:
at Module._load (node:internal/modules/cjs/loader:*:*)
at executeUserEntryPoint (node:internal/modules/run_main:*:*)
at node:internal/main/run_main_module:*:*
+
+Node.js *
diff --git a/test/message/throw_in_line_with_tabs.out b/test/message/throw_in_line_with_tabs.out
index 9392ef5cca2..0d71e91b75c 100644
--- a/test/message/throw_in_line_with_tabs.out
+++ b/test/message/throw_in_line_with_tabs.out
@@ -3,3 +3,5 @@ before
throw ({ foo: 'bar' });
^
{ foo: 'bar' }
+
+Node.js *
diff --git a/test/message/throw_non_error.out b/test/message/throw_non_error.out
index a744f786ca6..665c9b4fd1d 100644
--- a/test/message/throw_non_error.out
+++ b/test/message/throw_non_error.out
@@ -2,3 +2,5 @@
throw ({ foo: 'bar' });
^
{ foo: 'bar' }
+
+Node.js *
diff --git a/test/message/throw_null.out b/test/message/throw_null.out
index c97dcbfe134..0fe2a49d050 100644
--- a/test/message/throw_null.out
+++ b/test/message/throw_null.out
@@ -4,3 +4,5 @@ throw null;
^
null
(Use `* --trace-uncaught ...` to show where the exception was thrown)
+
+Node.js *
diff --git a/test/message/throw_null_traced.out b/test/message/throw_null_traced.out
index e1b471827f4..0344dc27e0a 100644
--- a/test/message/throw_null_traced.out
+++ b/test/message/throw_null_traced.out
@@ -11,3 +11,5 @@ Thrown at:
at Module._load (node:internal/modules/cjs/loader:*:*)
at executeUserEntryPoint (node:internal/modules/run_main:*:*)
at node:internal/main/run_main_module:*:*
+
+Node.js *
diff --git a/test/message/throw_undefined.out b/test/message/throw_undefined.out
index 4b2bfdbc590..56b0cac4259 100644
--- a/test/message/throw_undefined.out
+++ b/test/message/throw_undefined.out
@@ -4,3 +4,5 @@ throw undefined;
^
undefined
(Use `* --trace-uncaught ...` to show where the exception was thrown)
+
+Node.js *
diff --git a/test/message/throw_undefined_traced.out b/test/message/throw_undefined_traced.out
index fa89312ed4d..148085f094a 100644
--- a/test/message/throw_undefined_traced.out
+++ b/test/message/throw_undefined_traced.out
@@ -11,3 +11,5 @@ Thrown at:
at Module._load (node:internal/modules/cjs/loader:*:*)
at executeUserEntryPoint (node:internal/modules/run_main:*:*)
at node:internal/main/run_main_module:*:*
+
+Node.js *
diff --git a/test/message/timeout_throw.out b/test/message/timeout_throw.out
index 66e495eb84d..bc20cc7762f 100644
--- a/test/message/timeout_throw.out
+++ b/test/message/timeout_throw.out
@@ -5,3 +5,5 @@ ReferenceError: undefined_reference_error_maker is not defined
at Timeout._onTimeout (*test*message*timeout_throw.js:*:*)
at listOnTimeout (node:internal/timers:*:*)
at processTimers (node:internal/timers:*:*)
+
+Node.js *
diff --git a/test/message/undefined_reference_in_new_context.out b/test/message/undefined_reference_in_new_context.out
index 61dee9f6d4f..259bb6d1bc1 100644
--- a/test/message/undefined_reference_in_new_context.out
+++ b/test/message/undefined_reference_in_new_context.out
@@ -14,3 +14,5 @@ ReferenceError: foo is not defined
at Module.load (node:internal/modules/cjs/loader:*)
at Function.Module._load (node:internal/modules/cjs/loader:*:*)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*:*)
+
+Node.js *
diff --git a/test/message/vm_display_runtime_error.out b/test/message/vm_display_runtime_error.out
index 8f1e9c37967..403ad365451 100644
--- a/test/message/vm_display_runtime_error.out
+++ b/test/message/vm_display_runtime_error.out
@@ -29,3 +29,5 @@ Error: spooky!
at Function.Module._load (node:internal/modules/cjs/loader:*)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*)
at node:internal/main/run_main_module:*:*
+
+Node.js *
diff --git a/test/message/vm_display_syntax_error.out b/test/message/vm_display_syntax_error.out
index b0b70fcd759..4501ae7e81f 100644
--- a/test/message/vm_display_syntax_error.out
+++ b/test/message/vm_display_syntax_error.out
@@ -27,3 +27,5 @@ SyntaxError: Unexpected number
at Function.Module._load (node:internal/modules/cjs/loader:*)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*)
at node:internal/main/run_main_module:*:*
+
+Node.js *
diff --git a/test/message/vm_dont_display_runtime_error.out b/test/message/vm_dont_display_runtime_error.out
index 2ff2e8355ab..4ffe3cf4dc2 100644
--- a/test/message/vm_dont_display_runtime_error.out
+++ b/test/message/vm_dont_display_runtime_error.out
@@ -15,3 +15,5 @@ Error: boo!
at Function.Module._load (node:internal/modules/cjs/loader:*)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*)
at node:internal/main/run_main_module:*:*
+
+Node.js *
diff --git a/test/message/vm_dont_display_syntax_error.out b/test/message/vm_dont_display_syntax_error.out
index d46dce2993f..b9e8c24dd97 100644
--- a/test/message/vm_dont_display_syntax_error.out
+++ b/test/message/vm_dont_display_syntax_error.out
@@ -15,3 +15,5 @@ SyntaxError: Unexpected number
at Function.Module._load (node:internal/modules/cjs/loader:*)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*)
at node:internal/main/run_main_module:*:*
+
+Node.js *
diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js
index 0e824fe073d..2d34a56e03c 100644
--- a/test/parallel/test-cli-node-options.js
+++ b/test/parallel/test-cli-node-options.js
@@ -26,6 +26,7 @@ expect('--no-deprecation', 'B\n');
expect('--no-warnings', 'B\n');
expect('--no_warnings', 'B\n');
expect('--trace-warnings', 'B\n');
+expect('--no-extra-info-on-fatal-exception', 'B\n');
expect('--redirect-warnings=_', 'B\n');
expect('--trace-deprecation', 'B\n');
expect('--trace-sync-io', 'B\n');
diff --git a/test/parallel/test-error-reporting.js b/test/parallel/test-error-reporting.js
index 75574641ec7..6977c5f023c 100644
--- a/test/parallel/test-error-reporting.js
+++ b/test/parallel/test-error-reporting.js
@@ -77,6 +77,5 @@ errExec('throws_error6.js', common.mustCall((err, stdout, stderr) => {
// Object that throws in toString() doesn't print garbage
errExec('throws_error7.js', common.mustCall((err, stdout, stderr) => {
- assert.match(stderr,
- /throw {\r?\n\^\r?\n{ toString: \[Function: toString] }\r?\n$/);
+ assert.match(stderr, /throw {\r?\n\^\r?\n{ toString: \[Function: toString] }\r?\n\r?\nNode\.js \S+\r?\n$/);
}));
diff --git a/test/pseudo-tty/test-fatal-error.out b/test/pseudo-tty/test-fatal-error.out
index b6eeca17f55..72e2bbba04e 100644
--- a/test/pseudo-tty/test-fatal-error.out
+++ b/test/pseudo-tty/test-fatal-error.out
@@ -12,3 +12,5 @@ TypeError: foobar
*[90m at *[39m {
bla: *[33mtrue*[39m
}
+
+Node.js *