Avoid using prisma types on client (#23566)
This commit is contained in:
1 parent
1209150785
commit
be7d127c9e
1 file changed
+3
-9
@@ -1,18 +1,12 @@
|
||||
import { Prisma } from "@prisma/client";
|
||||
|
||||
import logger from "@calcom/lib/logger";
|
||||
|
||||
import { IS_PRODUCTION } from "./constants";
|
||||
|
||||
const log = logger.getSubLogger({ prefix: [`[redactError]`] });
|
||||
|
||||
function shouldRedact<T extends Error>(error: T) {
|
||||
return (
|
||||
error instanceof Prisma.PrismaClientInitializationError ||
|
||||
error instanceof Prisma.PrismaClientKnownRequestError ||
|
||||
error instanceof Prisma.PrismaClientUnknownRequestError ||
|
||||
error instanceof Prisma.PrismaClientValidationError
|
||||
);
|
||||
function shouldRedact(error: Error) {
|
||||
const n = error.name || "";
|
||||
return /Prisma/i.test(n);
|
||||
}
|
||||
|
||||
export const redactError = <T extends Error | unknown>(error: T) => {
|
||||
|
||||
Reference in new issue
Block a user