Skip to content

Commit ffcf307

Browse files
committed
fix: coderabbit feedback
1 parent 33ff4b3 commit ffcf307

File tree

1 file changed

+4
-3
lines changed
  • packages/app-store/stripepayment/api

1 file changed

+4
-3
lines changed

packages/app-store/stripepayment/api/portal.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { NextApiRequest, NextApiResponse } from "next";
22

33
import { WEBAPP_URL } from "@calcom/lib/constants";
44
import { getSafeRedirectUrl } from "@calcom/lib/getSafeRedirectUrl";
5+
import { HttpError } from "@calcom/lib/http-error";
56
import logger from "@calcom/lib/logger";
67
import { TeamRepository } from "@calcom/lib/server/repository/team";
78
import 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

4445
const 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;

0 commit comments

Comments
 (0)