Prisma errors can't be handled on client

This commit is contained in:
zomars 2022-06-13 10:37:42 -06:00
parent b044c6fb70
commit e0a391d46e

View File

@ -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;
}