I cannot figure out how to catch the Prisma `NotFo...
# orm-help
t
I cannot figure out how to catch the Prisma
NotFoundError
thrown from the `findFirst`'s
rejectOnNotFound
option. the
NotFoundError
class/type doesn't seem to be exposed to be imported.
r
@Tyler Clendenin 👋 It won’t be an error class but the error message would contain this so you need to check by the message.
t
Ahh, this makes it hard to use NestJS's
@Catch
decorator. seems the only thing to do is to manually create my own error type and pass it into the rejectOnNotFound findFirst and findUnique keys.
Is there a reason it's not exported?
r
Error management is something we need to look into. We have an epic that discusses all this here 🙂
t
ok, what would be the process to suggest exposing the
NotFoundError
class/type that the
rejectOnNotFound
throws?