#Prisma - problem with errors

19 messages · Page 1 of 1 (latest)

supple remnant
#

Why after I encouter errors like Unique constraint failed on the fields: (email)
my application is unable to catch any further requests?

gilded dust
#

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?

supple remnant
#

I see whats happening.

gilded dust
#

actually re-reading your question that shouldn't be it, enlighten me!

supple remnant
#

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()?

gilded dust
#

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.

wise estuary
#

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

gilded dust
#

That's sharp. I honestly did not spot that

supple remnant
#

Yep, that was it

#

Thanks ❤️

supple remnant
#

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?