Prisma errors can't be handled on client
This commit is contained in:
parent
b044c6fb70
commit
e0a391d46e
|
@ -1,9 +1,4 @@
|
|||
import { PrismaClientKnownRequestError } from "@prisma/client/runtime";
|
||||
|
||||
export function getErrorFromUnknown(cause: unknown): Error & { statusCode?: number; code?: string } {
|
||||
if (cause instanceof PrismaClientKnownRequestError) {
|
||||
return cause;
|
||||
}
|
||||
if (cause instanceof Error) {
|
||||
return cause;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user