Anna Henningsen
34471c79ff
src: order C++ error list alphabetically
...
PR-URL: https://github.com/nodejs/node/pull/20707
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2018-05-16 09:01:23 +04:00
Joyee Cheung
3152b7c0d3
src: assign ERR_SCRIPT_EXECUTION_* codes in C++
...
Also modifies the error messages so they include more information
and are more consistent.
- The message of ERR_SCRIPT_EXECUTION_INTERRUPTED now mentions
SIGINT and the trailing period is dropped for consistency.
- Added ERR_SCRIPT_EXECUTION_TIMEOUT and include the timeout
in the message.
PR-URL: https://github.com/nodejs/node/pull/20147
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2018-04-25 23:46:08 +08:00
Joyee Cheung
fb58cae1e2
src: throw ERR_MISSING_ARGS in node_crypto.cc
...
PR-URL: https://github.com/nodejs/node/pull/20121
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2018-04-19 12:13:02 +08:00
Joyee Cheung
a82902f087
src: throw ERR_INVALID_ARG_VALUE in node_crypto.cc
...
PR-URL: https://github.com/nodejs/node/pull/20121
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2018-04-19 12:13:01 +08:00
Joyee Cheung
02dc307ae2
src: throw ERR_MISSING_MODULE in module_wrap.cc
...
PR-URL: https://github.com/nodejs/node/pull/20121
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2018-04-19 12:12:58 +08:00
Joyee Cheung
8b1b36bfc5
src: throw ERR_BUFFER_OUT_OF_BOUNDS in node_buffer.cc
...
PR-URL: https://github.com/nodejs/node/pull/20121
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2018-04-19 12:09:28 +08:00
Joyee Cheung
2c23e31c31
src: throw ERR_INVALID_ARG_TYPE in C++ argument checks
...
- Moves THROW_AND_RETURN_IF_NOT_BUFFER and
THROW_AND_RETURN_IF_NOT_STRING from node_crypto.cc to
node_errors.h so it can be reused.
- Move THROW_AND_RETURN_UNLESS_BUFFER in util.h to
node_buffer.cc and call THROW_AND_RETURN_IF_NOT_BUFFER
there. The only other reference to THROW_AND_RETURN_UNLESS_BUFFER in
node_i18n.cc can be safely replaced by an assertion since
the argument will be checked in JS land.
- Migrate ERR_INVALID_ARG_TYPE errors in C++. We can move the
checks to JS land if possible later without having to
go semver-major.
PR-URL: https://github.com/nodejs/node/pull/20121
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2018-04-19 12:09:26 +08:00
Joyee Cheung
7e269f5266
src: migrate ERR_INDEX_OUT_OF_RANGE in C++
...
This patch migrates the "Index out of range" errors in C++
to errors with the code `ERR_INDEX_OUT_OF_RANGE` which have
equivalents in JavaScript.
PR-URL: https://github.com/nodejs/node/pull/20121
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2018-04-19 12:09:24 +08:00
Joyee Cheung
0f16528247
src: add THROW_ERR_* helpers
...
PR-URL: https://github.com/nodejs/node/pull/20121
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2018-04-19 12:09:23 +08:00
Joyee Cheung
362694401f
src: rename ERR_STRING_TOO_LARGE to ERR_STRING_TOO_LONG
...
The old error name and message were trying to be consistent with
ERR_BUFFER_TOO_LARGE but they were not really accurate.
The kStringMaxLength was measured in number of characters,
not number of bytes. The name ERR_STRING_TOO_LARGE also
seems a bit awkward. This patch tries to correct them before
they get released to users.
PR-URL: https://github.com/nodejs/node/pull/19864
Refs: https://github.com/nodejs/node/pull/19739
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
2018-04-10 01:08:10 +02:00
Joyee Cheung
289d152ce0
src: add error code helpers to src/node_errors.h
...
This commit adds node::ERR_*(isolate, message) helpers in
the C++ land to assign error codes to existing C++ errors.
The following errors are added:
- ERR_MEMORY_ALLOCATION_FAILED
- ERR_STRING_TOO_LARGE
PR-URL: https://github.com/nodejs/node/pull/19739
Fixes: https://github.com/nodejs/node/issues/3175
Fixes: https://github.com/nodejs/node/issues/9489
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2018-04-07 17:15:03 +08:00