From e4f614100f8b6e1a279b3a99a51df59e5f147a23 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Wed, 24 Mar 2021 16:07:26 -0700 Subject: [PATCH] src: document newer values for --unhandled-rejections flag These values were added in v15.0.0 by #33475 but were not included in the `node --help` output. Also documents which value is the default. PR-URL: https://github.com/nodejs/node/pull/37899 Fixes: https://github.com/nodejs/node/issues/37896 Refs: https://github.com/nodejs/node/issues/33475 Reviewed-By: Anna Henningsen Reviewed-By: Antoine du Hamel Reviewed-By: Darshan Sen Reviewed-By: James M Snell --- src/node_options.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/node_options.cc b/src/node_options.cc index d5edbf58bb8caf..0ed8dac7217753 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -476,8 +476,11 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { &EnvironmentOptions::trace_warnings, kAllowedInEnvironment); AddOption("--unhandled-rejections", - "define unhandled rejections behavior. Options are 'strict' (raise " - "an error), 'warn' (enforce warnings) or 'none' (silence warnings)", + "define unhandled rejections behavior. Options are 'strict' " + "(always raise an error), 'throw' (raise an error unless " + "'unhandledRejection' hook is set), 'warn' (log a warning), 'none' " + "(silence warnings), 'warn-with-error-code' (log a warning and set " + "exit code 1 unless 'unhandledRejection' hook is set).", &EnvironmentOptions::unhandled_rejections, kAllowedInEnvironment);