-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
bug/2-confirmedBug has been reproduced and confirmed.Bug has been reproduced and confirmed.kind/bugA reported bug.A reported bug.
Milestone
Description
Also their is no way to catch and massage the error (to change its message for example).
With
findUniqueOrThrow
, in a middlewareresult
isnull
andparams.action
isfindUnique
:prismaClient.$use(async (params, next) => { try { const result = await next(params); return result; } catch (error) { // nothing to see here throw error; } });With
rejectOnNotFound
, the un-exported error (treatable witherror.constructor.name === 'NotFoundError'
btw) was thrown inside.
Originally posted by @bbenezech in #14209 (comment)
Metadata
Metadata
Assignees
Labels
bug/2-confirmedBug has been reproduced and confirmed.Bug has been reproduced and confirmed.kind/bugA reported bug.A reported bug.