mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-04 00:48:52 +02:00
📈 Capture exception when creating a new participant (#1288)
This commit is contained in:
parent
3ef8fc1778
commit
5d8651740d
2 changed files with 4 additions and 2 deletions
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue