tls: migrate tls.js to use internal/errors.js
Migrate tls.js to use internal/errors.js as per https://github.com/nodejs/node/issues/11273
The internal code used to set the 'code' as the client.authorizationError, or if no code existed the 'message' as the client.authorizationError. Since with the new approach there is always a 'code' we end up setting the less descriptive code. I guess that is consistent though with what was being done for existing errors with a code anyway.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
tls