Removing seemingly troubling code

pull/5501/head
Leo Giovanetti 2022-11-16 16:44:18 -03:00
parent bcc70fc337
commit eaae772abc
2 changed files with 3 additions and 3 deletions

View File

@ -29,7 +29,6 @@ export async function getHandler(req: NextApiRequest, res: NextApiResponse) {
}); });
} catch (reason) { } catch (reason) {
logger.error("Could not add Sendgrid app", 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" }; return { url: "/apps/installed/other?hl=sendgrid" };

View File

@ -2,6 +2,7 @@ import type { NextApiRequest, NextApiResponse } from "next";
import Sendgrid from "@calcom/lib/Sendgrid"; import Sendgrid from "@calcom/lib/Sendgrid";
import { HttpError } from "@calcom/lib/http-error"; import { HttpError } from "@calcom/lib/http-error";
import logger from "@calcom/lib/logger";
import { defaultResponder } from "@calcom/lib/server"; import { defaultResponder } from "@calcom/lib/server";
import checkSession from "../../_utils/auth"; import checkSession from "../../_utils/auth";
@ -19,10 +20,10 @@ export async function getHandler(req: NextApiRequest, res: NextApiResponse) {
if (usernameInfo.username) { if (usernameInfo.username) {
return {}; return {};
} else { } else {
throw new HttpError({ statusCode: 404 }); logger.error("Could not check Sendgrid app API key");
} }
} catch (e) { } catch (e) {
throw new HttpError({ statusCode: 500, message: e as string }); logger.error("Could not check Sendgrid app API key", e);
} }
} }