From eaae772abcd04c8f046e4960116f42c5aaf87adf Mon Sep 17 00:00:00 2001 From: Leo Giovanetti Date: Wed, 16 Nov 2022 16:44:18 -0300 Subject: [PATCH] Removing seemingly troubling code --- packages/app-store/sendgrid/api/_postAdd.ts | 1 - packages/app-store/sendgrid/api/_postCheck.ts | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/app-store/sendgrid/api/_postAdd.ts b/packages/app-store/sendgrid/api/_postAdd.ts index fbec85e005..dd7a6d7813 100644 --- a/packages/app-store/sendgrid/api/_postAdd.ts +++ b/packages/app-store/sendgrid/api/_postAdd.ts @@ -29,7 +29,6 @@ export async function getHandler(req: NextApiRequest, res: NextApiResponse) { }); } catch (reason) { logger.error("Could not add Sendgrid app", reason); - throw new HttpError({ message: "Could not add Sendgrid app", statusCode: 500 }); } return { url: "/apps/installed/other?hl=sendgrid" }; diff --git a/packages/app-store/sendgrid/api/_postCheck.ts b/packages/app-store/sendgrid/api/_postCheck.ts index 57c8f44247..89aad1e02c 100644 --- a/packages/app-store/sendgrid/api/_postCheck.ts +++ b/packages/app-store/sendgrid/api/_postCheck.ts @@ -2,6 +2,7 @@ import type { NextApiRequest, NextApiResponse } from "next"; import Sendgrid from "@calcom/lib/Sendgrid"; import { HttpError } from "@calcom/lib/http-error"; +import logger from "@calcom/lib/logger"; import { defaultResponder } from "@calcom/lib/server"; import checkSession from "../../_utils/auth"; @@ -19,10 +20,10 @@ export async function getHandler(req: NextApiRequest, res: NextApiResponse) { if (usernameInfo.username) { return {}; } else { - throw new HttpError({ statusCode: 404 }); + logger.error("Could not check Sendgrid app API key"); } } catch (e) { - throw new HttpError({ statusCode: 500, message: e as string }); + logger.error("Could not check Sendgrid app API key", e); } }