oracle / node-oracledb

Oracle Database driver for Node.js maintained by Oracle Corp.
http://oracle.github.io/node-oracledb/
Other
2.24k stars 1.07k forks source link

Decorator for display errors #1513

Open Abdel-Monaam-Aouini opened 1 year ago

Abdel-Monaam-Aouini commented 1 year ago

https://docs.oracle.com/en/database/oracle/oracle-database/18/drdas/error-code.html#GUID-3DB3995E-5FF8-4650-9216-A5B5C41CE2D7 image

cjbj commented 1 year ago

Can you explain more about how you would this to be exposed? Would like to submit a PR with the suggestion?

Abdel-Monaam-Aouini commented 1 year ago

Can you explain more about how you would this to be exposed? Would like to submit a PR with the suggestion?

when you have an error in your query, you don't know what's wrong, you waste a lot of time to know what's the error, these errors do not make sense,

cjbj commented 1 year ago

@Monaam12 what exactly are you suggesting? The ORA errors are documented in https://docs.oracle.com/en/database/oracle/oracle-database/21/errmg/index.html However the ORA codes are not in the scope of this project since they are returned from the DB or Client libraries to node-oracledb and we can't change or control them directly. What do you want from node-oracledb? A mapping to SQLCODES? More doc? Or something else? I'm interested to know. Even if I can't make direct changes to other Oracle components I can always send feedback to the owners.

cjbj commented 1 year ago

@Monaam12 can you clarify what you would like?

Abdel-Monaam-Aouini commented 1 year ago

@Monaam12 can you clarify what you would like?

my point is about errors are not friendly for developers when you make something wrong!

I mean we can add something like this https://github.com/sequelize/sequelize/blob/main/src/errors/base-error.ts