Skip to content

Commit 12a9351

Browse files
committed
Ensure errors from initOracleClient() have the code attribut set properly
1 parent 2ae5048 commit 12a9351

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/oracledb.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -680,10 +680,11 @@ function initOracleClient(arg1) {
680680
try {
681681
oracledbCLib.initOracleClient(options, impl, settings);
682682
} catch (err) {
683-
if (err.message.match(/DPI-1047/)) {
684-
err.message += "\n" + nodbUtil.getInstallHelp();
683+
const newErr = errors.transformErr(err);
684+
if (newErr.code === "DPI-1047") {
685+
newErr.message += "\n" + nodbUtil.getInstallHelp();
685686
}
686-
throw err;
687+
throw newErr;
687688
}
688689
_initOracleClientArgs = arg1 || {};
689690
} else if (!util.isDeepStrictEqual(_initOracleClientArgs, options)) {

0 commit comments

Comments
 (0)