Closed haarse closed 2 years ago
The faded font for properties message and stack means that the properties are non-enumerable. /Håkan
This isn't specific to node-oracledb:
let x = new Error('abc');
console.log(x.propertyIsEnumerable('message')); // false
Ok, thanks. I missed to check that.
Comments, ideas and suggestions for improving error messages are welcome. (In particular I'd love to see a PR to print the error stack better, see https://github.com/oracle/node-oracledb/issues/465)
This issue has been automatically marked as inactive because it has not been updated recently. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not been updated for a month.
I'm trying to write the eventually Oracle error I get to a file. But when using JSON.stringify(err), the properties message and stack seems to be non-enumerable. I found it impossible to save these two properties and write them out. Is this true? I'm using Typescript, but I don't think that is the problem.
`try { connection = await oracledb.getConnection( { user : "hr", password : mypw, connectString : "localhost/XEPDB1" });
} catch (err) { console.log(JSON.stringify(err)); console.error(err); } finally { }`
You can see the difference in the two console functions result. Can I get the values it in some other way?