Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

📈 Capture exception when creating a new participant (#1288)

Luke Vella5d8651740d10
diff --git a/apps/web/src/components/new-participant-modal.tsx b/apps/web/src/components/new-participant-modal.tsx
index 6dc75dba1..d0bf64725 100644
--- a/apps/web/src/components/new-participant-modal.tsx
+++ b/apps/web/src/components/new-participant-modal.tsx
@@ -4,6 +4,7 @@ import { Badge } from "@rallly/ui/badge";
import { Button } from "@rallly/ui/button";
import { FormMessage } from "@rallly/ui/form";
import { Input } from "@rallly/ui/input";
+import * as Sentry from "@sentry/nextjs";
import { TRPCClientError } from "@trpc/client";
import clsx from "clsx";
import { useTranslation } from "next-i18next";
@@ -115,9 +116,10 @@ export const NewParticipantForm = (props: NewParticipantModalProps) => {
} catch (error) {
if (error instanceof TRPCClientError) {
setError("root", {
- message: error.shape.message,
+ message: error.message,
});
}
+ Sentry.captureException(error);
}
})}
className="space-y-4"
diff --git a/packages/backend/trpc/routers/polls/participants.ts b/packages/backend/trpc/routers/polls/participants.ts
index 8b5dae388..fe1cb5167 100644
--- a/packages/backend/trpc/routers/polls/participants.ts
+++ b/packages/backend/trpc/routers/polls/participants.ts
@@ -74,7 +74,7 @@ export const participants = router({
if (!success) {
throw new TRPCError({
code: "TOO_MANY_REQUESTS",
- message: "You are doing that too much",
+ message: "Rate limit exceeded. Please try again later.",
});
}
const { user } = ctx;