ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
188 stars 151 forks source link

unhandledrejection #996

Open huineng opened 1 month ago

huineng commented 1 month ago

ibm_db 3.2.4. node 20.12.2

i was doing some development as usual using some try { await conn.query(sql,bindings) } catch (err) { throw err} (or Promise.reject)

the problem was that i by mistake provided for bindings [['string']] instead of ['string']

So i got my rejecting and this had a message like

stack: Error: Wrong param format!
   at /node_modules/ibm_db/lib/odbc.js:677:19
   at SimpleQueue.next (/node_modules/ibm_db/lib/simple-queue.js:34:5)
   at SimpleQueue.maybeNext (/node_modules/ibm_db/lib/simple-queue.js:22:10)
   at SimpleQueue.push (/node_modules/ibm_db/lib/simple-queue.js:15:8)
   at Database.query (/node_modules/ibm_db/lib/odbc.js:520:14)

i guess this is from this line https://github.com/ibmdb/node-ibm_db/blob/a2f0018a74f076832c569f38af7ba2b6b7e73553/src/odbc.cpp#L988

fine

But then i got also a unhandledrejection with reason

reason: Error: [IBM][CLI Driver] CLI0123E  SQL data type out of range. SQLSTATE=HY004

so it looks to me the code doesn't stop at the first error

thanks