fix: catch HttpError in getRoutedUrl (#23844)

* fix: catch HttpError in getRoutedUrl

* fixup! fix: catch HttpError in getRoutedUrl
This commit is contained in:
Morgan
2025-09-15 14:34:43 +00:00
committed by GitHub
parent 41553f6c01
commit 3aca339c95
@@ -23,10 +23,10 @@ import { withReporting } from "@calcom/lib/sentryWrapper";
import { PrismaRoutingFormRepository } from "@calcom/lib/server/repository/PrismaRoutingFormRepository";
import { UserRepository } from "@calcom/lib/server/repository/user";
import prisma from "@calcom/prisma";
import { TRPCError } from "@trpc/server";
import { getUrlSearchParamsToForward } from "./getUrlSearchParamsToForward";
import { HttpError } from "@calcom/lib/http-error";
const log = logger.getSubLogger({ prefix: ["[routing-forms]", "[router]"] });
const querySchema = z
@@ -171,7 +171,7 @@ const _getRoutedUrl = async (context: Pick<GetServerSidePropsContext, "query" |
crmContactOwnerRecordType = result.crmContactOwnerRecordType;
crmAppSlug = result.crmAppSlug;
} catch (e) {
if (e instanceof TRPCError) {
if (e instanceof HttpError || e instanceof TRPCError) {
return {
props: {
...pageProps,
@@ -181,7 +181,7 @@ const _getRoutedUrl = async (context: Pick<GetServerSidePropsContext, "query" |
},
};
}
log.error("Error handling the response", safeStringify(e));
throw new Error("Error handling the response");
}