#Prisma - problem with errors
19 messages · Page 1 of 1 (latest)
looks like the error bubbles up but doesn't get caught so the server crashes
IIRC nest should have a default exception filter? Did you add your own?
actually re-reading your question that shouldn't be it, enlighten me!
I recently added the CLS library package to set async context
and used it to the transactions, to not provide every time in parameters transactionobject
and it seems like there's a problem
I even added the manually catching and throwing it up
Do you know what's happening there? @wise estuary aren't errors bubbling out of the run()?
I'm unclear on what the problem is, you get a 500 is there any more info like a stack trace?
also, it looks weird to me that you clear the transaction in a finally block, is the transaction already comitted by then? considering that you are still inside the transaction. Shouldn't matter though, its just another observation.
Why after I encouter errors like Unique constraint failed on the fields
There is some uncaught promise somewhere that shuts down the process, that is the most likely scenario
It's right here, the call is not awaited, so anything thrown inside will cause an unhandled promise rejection. You need to await the cls.run call if you pass in an async method
That's sharp. I honestly did not spot that
So I suppose any unhandled rejection is killer for an app?
Like there would be a fs.write() without a .catch or await. If there would be an error my application would be stuck?