diff options
author | Michaël Zasso <targos@protonmail.com> | 2018-03-06 14:23:36 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-03-10 12:15:12 +0100 |
commit | 0eec0735d0bcbb4290f032cd71f2356376bd13d7 (patch) | |
tree | f20a41ee094409817644534ac49299bd920be779 /CPP_STYLE_GUIDE.md | |
parent | 49963f4da9fba92d54536fa39786478dd96c057c (diff) | |
download | android-node-v8-0eec0735d0bcbb4290f032cd71f2356376bd13d7.tar.gz android-node-v8-0eec0735d0bcbb4290f032cd71f2356376bd13d7.tar.bz2 android-node-v8-0eec0735d0bcbb4290f032cd71f2356376bd13d7.zip |
doc: update internal errors documentation
PR-URL: https://github.com/nodejs/node/pull/19203
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'CPP_STYLE_GUIDE.md')
-rw-r--r-- | CPP_STYLE_GUIDE.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/CPP_STYLE_GUIDE.md b/CPP_STYLE_GUIDE.md index 5a275094ad..edc5f0f12e 100644 --- a/CPP_STYLE_GUIDE.md +++ b/CPP_STYLE_GUIDE.md @@ -256,13 +256,13 @@ env->SetMethod(target, "foo", Foo); exports.foo = function(str) { // Prefer doing the type-checks in JavaScript if (typeof str !== 'string') { - throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'str', 'string'); + throw new errors.codes.ERR_INVALID_ARG_TYPE('str', 'string'); } const ctx = {}; const result = binding.foo(str, ctx); if (ctx.code !== undefined) { - throw new errors.Error('ERR_ERROR_NAME', ctx.code); + throw new errors.codes.ERR_ERROR_NAME(ctx.code); } return result; }; |