Console build fixes

pull/3054/head
zomars 2022-06-13 10:31:00 -06:00
parent 5653282dea
commit 06482388bd
2 changed files with 4 additions and 4 deletions

View File

@ -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 } { export function getErrorFromUnknown(cause: unknown): Error & { statusCode?: number; code?: string } {
if (cause instanceof Prisma.PrismaClientKnownRequestError) { if (cause instanceof PrismaClientKnownRequestError) {
return cause; return cause;
} }
if (cause instanceof Error) { if (cause instanceof Error) {

View File

@ -1,11 +1,11 @@
import { Prisma } from "@prisma/client"; import { PrismaClientKnownRequestError } from "@prisma/client/runtime";
import Stripe from "stripe"; import Stripe from "stripe";
import { ZodError } from "zod"; import { ZodError } from "zod";
import { HttpError } from "../http-error"; import { HttpError } from "../http-error";
export function getServerErrorFromUnkown(cause: unknown): HttpError { export function getServerErrorFromUnkown(cause: unknown): HttpError {
if (cause instanceof Prisma.PrismaClientKnownRequestError) { if (cause instanceof PrismaClientKnownRequestError) {
return new HttpError({ statusCode: 400, message: cause.message, cause }); return new HttpError({ statusCode: 400, message: cause.message, cause });
} }
if (cause instanceof Error) { if (cause instanceof Error) {