···
106
-
.onError(({ code, error }) => {
106
+
.onError(({ code, error, request }) => {
if (error instanceof Error)
`\x1b[31m x\x1b[0m unhandled error: \x1b[31m${error.message}\x1b[0m`,
111
-
Sentry.captureException(error);
111
+
Sentry.withScope((scope) => {
112
+
scope.setExtra("url", request.url);
113
+
scope.setExtra("code", code);
114
+
Sentry.captureException(error);
if (code === "VALIDATION") {
···
173
-
async ({ params, error }) => {
177
+
async ({ params, error, request }) => {
const user = await cache.getUser(params.user);
// if not found then check slack first
···
if (e instanceof Error && e.message === "user_not_found")
return error(404, { message: "User not found" });
185
-
Sentry.captureException(e);
189
+
Sentry.withScope((scope) => {
190
+
scope.setExtra("url", request.url);
191
+
scope.setExtra("user", params.user);
192
+
Sentry.captureException(e);
···
250
-
async ({ params, error, redirect }) => {
258
+
async ({ params, error, redirect, request }) => {
const user = await cache.getUser(params.user);
// if not found then check slack first
···
if (e instanceof Error && e.message === "user_not_found")
return error(404, { message: "User not found" });
262
-
Sentry.captureException(e);
270
+
Sentry.withScope((scope) => {
271
+
scope.setExtra("url", request.url);
272
+
scope.setExtra("user", params.user);
273
+
Sentry.captureException(e);