File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import { Prisma } from "@prisma/client";
22import type { ZodIssue } from "zod" ;
33import { ZodError } from "zod" ;
44
5- import { stripeInvalidRequestErrorSchema } from "@calcom/app-store/_utils/stripe.types" ;
65import { ErrorCode } from "@calcom/lib/errorCodes" ;
76import { ErrorWithCode } from "@calcom/lib/errors" ;
87
@@ -11,6 +10,7 @@ import { getHTTPStatusCodeFromError } from "@trpc/server/http";
1110
1211import { HttpError } from "../http-error" ;
1312import { redactError } from "../redactError" ;
13+ import { stripeInvalidRequestErrorSchema } from "../stripe-error" ;
1414
1515function hasName ( cause : unknown ) : cause is { name : string } {
1616 return ! ! cause && typeof cause === "object" && "name" in cause ;
Original file line number Diff line number Diff line change 1+ import { z } from "zod" ;
2+
3+ const errorSchema = z . object ( {
4+ name : z . string ( ) ,
5+ message : z . string ( ) ,
6+ stack : z . string ( ) . optional ( ) ,
7+ } ) ;
8+
9+ export const stripeInvalidRequestErrorSchema = errorSchema . extend ( {
10+ type : z . literal ( "StripeInvalidRequestError" ) ,
11+ rawType : z . literal ( "invalid_request_error" ) ,
12+ code : z . string ( ) . optional ( ) ,
13+ doc_url : z . string ( ) . optional ( ) ,
14+ statusCode : z . number ( ) . optional ( ) ,
15+ raw : z . unknown ( ) ,
16+ headers : z . record ( z . string ( ) ) ,
17+ requestId : z . string ( ) ,
18+ param : z . string ( ) . optional ( ) ,
19+ } ) ;
You can’t perform that action at this time.
0 commit comments