Closed akheron closed 5 years ago
I'm just wondering whether they are in that order for a reason?
It seems that this is a bug. I'll try provide fix + regression for this case later today. @akheron Thanks a lot!
I actually already have a patch, but cannot figure out a way to check that unhandled promise rejections don't happen in the node "main loop" :thinking:
src/Database/PostgreSQL.js
has this:The
catch
andthen
handlers are in such an order thatthen
is called even if an error was thrown, and as suchresult
isundefined
soresult.rows
throws an error. As a consequence, upon integrity error this is logged to console:The fix seems to be to change the code to have
then
beforecatch
. I'm just wondering whether they are in that order for a reason?