src: add error codes to errors thrown in C++
This PR follows https://github.com/nodejs/node/pull/20121 and adds error codes to a few errors thrown in C++.
Moreover, InlineDecoder::Decode
has been refactored to avoid throwing an exception related to StringBytes::IsValidString
inside the Decode
method.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines