You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the expected behavior should be promise rejection, because in JavaScript exceptions (and promise rejection reasons) can be of any type (including undefined).
This happens because we pass undefined to transaction.rollback() here:
Environment
Knex version: 3.1.0
Database + version: posgtres 14.2
OS: MacOS 13.5.1
Bug
When a transaction callback rejects with
undefined
, the transaction promise is resolved.I think the expected behavior should be promise rejection, because in JavaScript exceptions (and promise rejection reasons) can be of any type (including
undefined
).transaction.rollback()
here:knex/lib/execution/transaction.js
Lines 242 to 244 in 9659a20
And if
doNotRejectOnRollback
enabled (it is by default) and the passed error is undefined, we do resolve:knex/lib/execution/transaction.js
Lines 179 to 183 in 9659a20
The text was updated successfully, but these errors were encountered: