Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d8937f1

Browse filesBrowse files
marco-ippolitotargos
authored andcommitted
src: create THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING
PR-URL: #57016 Refs: #53787 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Tierney Cyren <hello@bnb.im> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it>
1 parent 9fd217d commit d8937f1
Copy full SHA for d8937f1

File tree

Expand file treeCollapse file tree

3 files changed

+20
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+20
-7
lines changed
Open diff view settings
Collapse file

‎doc/api/errors.md‎

Copy file name to clipboardExpand all lines: doc/api/errors.md
+10Lines changed: 10 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2377,6 +2377,16 @@ added: v15.0.0
23772377
An operation failed. This is typically used to signal the general failure
23782378
of an asynchronous operation.
23792379

2380+
<a id="ERR_OPTIONS_BEFORE_BOOTSTRAPPING"></a>
2381+
2382+
### `ERR_OPTIONS_BEFORE_BOOTSTRAPPING`
2383+
2384+
<!-- YAML
2385+
added: REPLACEME
2386+
-->
2387+
2388+
An attempt was made to get options before the bootstrapping was completed.
2389+
23802390
<a id="ERR_OUT_OF_RANGE"></a>
23812391

23822392
### `ERR_OUT_OF_RANGE`
Collapse file

‎src/node_errors.h‎

Copy file name to clipboardExpand all lines: src/node_errors.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ void OOMErrorHandler(const char* location, const v8::OOMDetails& details);
102102
V(ERR_MODULE_NOT_FOUND, Error) \
103103
V(ERR_NON_CONTEXT_AWARE_DISABLED, Error) \
104104
V(ERR_OPERATION_FAILED, TypeError) \
105+
V(ERR_OPTIONS_BEFORE_BOOTSTRAPPING, Error) \
105106
V(ERR_OUT_OF_RANGE, RangeError) \
106107
V(ERR_REQUIRE_ASYNC_MODULE, Error) \
107108
V(ERR_SCRIPT_EXECUTION_INTERRUPTED, Error) \
Collapse file

‎src/node_options.cc‎

Copy file name to clipboardExpand all lines: src/node_options.cc
+9-7Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "env-inl.h"
55
#include "node_binding.h"
6+
#include "node_errors.h"
67
#include "node_external_reference.h"
78
#include "node_internals.h"
89
#include "node_sea.h"
@@ -1344,8 +1345,8 @@ void GetCLIOptionsValues(const FunctionCallbackInfo<Value>& args) {
13441345

13451346
if (!env->has_run_bootstrapping_code()) {
13461347
// No code because this is an assertion.
1347-
return env->ThrowError(
1348-
"Should not query options before bootstrapping is done");
1348+
THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING(
1349+
isolate, "Should not query options before bootstrapping is done");
13491350
}
13501351
env->set_has_serialized_options(true);
13511352

@@ -1466,8 +1467,8 @@ void GetCLIOptionsInfo(const FunctionCallbackInfo<Value>& args) {
14661467

14671468
if (!env->has_run_bootstrapping_code()) {
14681469
// No code because this is an assertion.
1469-
return env->ThrowError(
1470-
"Should not query options before bootstrapping is done");
1470+
THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING(
1471+
isolate, "Should not query options before bootstrapping is done");
14711472
}
14721473

14731474
Mutex::ScopedLock lock(per_process::cli_options_mutex);
@@ -1535,7 +1536,8 @@ void GetEmbedderOptions(const FunctionCallbackInfo<Value>& args) {
15351536
Environment* env = Environment::GetCurrent(args);
15361537
if (!env->has_run_bootstrapping_code()) {
15371538
// No code because this is an assertion.
1538-
return env->ThrowError(
1539+
THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING(
1540+
env->isolate(),
15391541
"Should not query options before bootstrapping is done");
15401542
}
15411543
Isolate* isolate = args.GetIsolate();
@@ -1571,8 +1573,8 @@ void GetEnvOptionsInputType(const FunctionCallbackInfo<Value>& args) {
15711573

15721574
if (!env->has_run_bootstrapping_code()) {
15731575
// No code because this is an assertion.
1574-
return env->ThrowError(
1575-
"Should not query options before bootstrapping is done");
1576+
THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING(
1577+
isolate, "Should not query options before bootstrapping is done");
15761578
}
15771579

15781580
Mutex::ScopedLock lock(per_process::cli_options_mutex);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.