diff options
author | Yaniv Friedensohn <yaniv.friedensohn@gmail.com> | 2019-06-14 13:17:40 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-06-21 13:10:48 +0300 |
commit | e6edd66c10632715326a3ef830c6808d7da069f6 (patch) | |
tree | e1d966147107bef3b52c68a108fd88d8d421f2eb /src/node_i18n.cc | |
parent | 7334aaf2eaf3ae9a0bca30329bf833bb5f9f84d2 (diff) |
src: add error codes to errors thrown in node_i18n.cc
PR-URL: https://github.com/nodejs/node/pull/28221
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/node_i18n.cc')
-rw-r--r-- | src/node_i18n.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node_i18n.cc b/src/node_i18n.cc index ad5c8283924..162f5fda5d4 100644 --- a/src/node_i18n.cc +++ b/src/node_i18n.cc @@ -655,7 +655,7 @@ static void ToUnicode(const FunctionCallbackInfo<Value>& args) { int32_t len = ToUnicode(&buf, *val, val.length()); if (len < 0) { - return env->ThrowError("Cannot convert name to Unicode"); + return THROW_ERR_INVALID_ARG_VALUE(env, "Cannot convert name to Unicode"); } args.GetReturnValue().Set( @@ -678,7 +678,7 @@ static void ToASCII(const FunctionCallbackInfo<Value>& args) { int32_t len = ToASCII(&buf, *val, val.length(), mode); if (len < 0) { - return env->ThrowError("Cannot convert name to ASCII"); + return THROW_ERR_INVALID_ARG_VALUE(env, "Cannot convert name to ASCII"); } args.GetReturnValue().Set( |