fix: improve error messages for PayPal credential validation (#22786)

* fix: improve error messages for PayPal credential validation

* chore

* chore
This commit is contained in:
Sahitya Chandra authored and GitHub committed 2025-07-29 15:43:10 +00:00
1 parent 12b418b532
commit 7b6d5d6de3
2 files changed
+5 -2

No files matched your search

@@ -5,8 +5,8 @@ import { Toaster } from "sonner";
import AppNotInstalledMessage from "@calcom/app-store/_components/AppNotInstalledMessage";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc";
import { TextField } from "@calcom/ui/components/form";
import { Button } from "@calcom/ui/components/button";
import { TextField } from "@calcom/ui/components/form";
import { Icon } from "@calcom/ui/components/icon";
import { showToast } from "@calcom/ui/components/toast";
@@ -30,7 +30,10 @@ export const handleCustomValidations = async ({
const validator = (await validatorGetter()).default;
return await validator({ input, ctx });
} catch (error) {
throw new TRPCError({ code: "BAD_REQUEST" });
throw new TRPCError({
code: "BAD_REQUEST",
message: error instanceof Error ? error.message : "Validation failed",
});
}
};