File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
packages/app-store/stripepayment/api Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import type { NextApiRequest, NextApiResponse } from "next";
22
33import { WEBAPP_URL } from "@calcom/lib/constants" ;
44import { getSafeRedirectUrl } from "@calcom/lib/getSafeRedirectUrl" ;
5+ import { HttpError } from "@calcom/lib/http-error" ;
56import logger from "@calcom/lib/logger" ;
67import { TeamRepository } from "@calcom/lib/server/repository/team" ;
78import prisma from "@calcom/prisma" ;
@@ -31,19 +32,19 @@ const getValidatedTeamSubscriptionId = async (metadata: Prisma.JsonValue) => {
3132 const teamMetadataParsed = teamMetadataSchema . safeParse ( metadata ) ;
3233
3334 if ( ! teamMetadataParsed . success ) {
34- throw new Error ( "Invalid team metadata" ) ;
35+ throw new HttpError ( { statusCode : 400 , message : "Invalid team metadata" } ) ;
3536 }
3637
3738 if ( ! teamMetadataParsed . data ?. subscriptionId ) {
38- throw new Error ( "Subscription Id not found for team" ) ;
39+ throw new HttpError ( { statusCode : 400 , message : "Subscription Id not found for team" } ) ;
3940 }
4041
4142 return teamMetadataParsed . data . subscriptionId ;
4243} ;
4344
4445const getValidatedTeamSubscriptionIdForPlatform = async ( subscriptionId ?: string | null ) => {
4546 if ( ! subscriptionId ) {
46- throw new Error ( "Subscription Id not found for team" ) ;
47+ throw new HttpError ( { statusCode : 400 , message : "Subscription Id not found for team" } ) ;
4748 }
4849
4950 return subscriptionId ;
You can’t perform that action at this time.
0 commit comments