Console build fixes
parent
5653282dea
commit
06482388bd
|
@ -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) {
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue