amitkr / nodejs-db-informix

Infomix bindings for nodejs
MIT License
3 stars 3 forks source link

Responding to errors from queries #10

Closed delemach closed 10 years ago

delemach commented 10 years ago

Queries that fail don't seem to throw errors pass back error objects to the callback function.

For example, I tested by passing in an INSERT statement that I knew would fail due to constraint violations. I see in the console log:

Query: [2]23000 X23000:-268:Integrity constraint violation

But there seems to be no feedback at all other than this direct console logging that the query failed. Can you help?

amitkr commented 10 years ago

Pushed some changes on branch v0.0.10 (not on npm yet) to return something like

{ '0': 'sqlstate: 23000, error: X23000:-391:Integrity constraint violation , msg: Could not execute query.' }

hope it helps. Let me know if you find more bugs. I'll be happy to look.

cheers. a;

delemach commented 10 years ago

I verified this works. Thanks so much. Can you publish it?

amitkr commented 10 years ago

will publish it in v0.0.10