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

This commit is contained in:
Luke Vella 2024-08-31 10:00:31 +01:00 committed by GitHub
parent 3ef8fc1778
commit 5d8651740d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -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"

View file

@ -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;