Skip to content

Commit

Permalink
fix: Add email in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 committed Dec 10, 2023
1 parent b1bf8c2 commit 05849a7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/Demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { postData } from "@/util/helpers";
import { sentryException } from "@/util/sentry";
import { useUser } from "@/util/useUser";

function alertError(e: string) {
function alertError(email: string, e: string) {
alert(
`An unexpected error happened. Can you email [email protected] with this message (or a screenshot)?\n\n${e}`
`An unexpected error happened. Can you email [email protected] with this message (or a screenshot)?\n\nEmail: ${email}\n${e}`
);
}

Expand All @@ -32,6 +32,7 @@ export function Demo({ onVerified }: DemoProps): React.ReactElement {

if (!userDetails) {
alertError(
"n/a",
`userDetails is undefined for user ${user?.id || "undefined"}`
);
return;
Expand All @@ -52,7 +53,7 @@ export function Demo({ onVerified }: DemoProps): React.ReactElement {
})
.catch((err: Error) => {
sentryException(err);
alertError(err.message);
alertError(email, err.message);
setLoading(false);
});
}
Expand Down

1 comment on commit 05849a7

@vercel
Copy link

@vercel vercel bot commented on 05849a7 Dec 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.