From 06482388bdcbc086e06f820c8a64a543ae5bfc92 Mon Sep 17 00:00:00 2001 From: zomars Date: Mon, 13 Jun 2022 10:31:00 -0600 Subject: [PATCH] Console build fixes --- packages/lib/errors.ts | 4 ++-- packages/lib/server/getServerErrorFromUnkown.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/lib/errors.ts b/packages/lib/errors.ts index 78d35001e5..d8731d3421 100644 --- a/packages/lib/errors.ts +++ b/packages/lib/errors.ts @@ -1,7 +1,7 @@ -import { Prisma } from "@prisma/client"; +import { PrismaClientKnownRequestError } from "@prisma/client/runtime"; export function getErrorFromUnknown(cause: unknown): Error & { statusCode?: number; code?: string } { - if (cause instanceof Prisma.PrismaClientKnownRequestError) { + if (cause instanceof PrismaClientKnownRequestError) { return cause; } if (cause instanceof Error) { diff --git a/packages/lib/server/getServerErrorFromUnkown.ts b/packages/lib/server/getServerErrorFromUnkown.ts index 7e90d2b06a..45c3018d38 100644 --- a/packages/lib/server/getServerErrorFromUnkown.ts +++ b/packages/lib/server/getServerErrorFromUnkown.ts @@ -1,11 +1,11 @@ -import { Prisma } from "@prisma/client"; +import { PrismaClientKnownRequestError } from "@prisma/client/runtime"; import Stripe from "stripe"; import { ZodError } from "zod"; import { HttpError } from "../http-error"; export function getServerErrorFromUnkown(cause: unknown): HttpError { - if (cause instanceof Prisma.PrismaClientKnownRequestError) { + if (cause instanceof PrismaClientKnownRequestError) { return new HttpError({ statusCode: 400, message: cause.message, cause }); } if (cause instanceof Error) {