Skip to content

Commit 4c75f85

Browse files
authored
fix(remix): Skip capturing aborted requests. (#9659)
Remix documentation suggests users avoid capturing aborted requests.
1 parent 61bcf73 commit 4c75f85

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/remix/src/utils/instrumentServer.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ export async function captureRemixServerException(err: unknown, name: string, re
8989
return;
9090
}
9191

92+
// Skip capturing if the request is aborted as Remix docs suggest
93+
// Ref: https://remix.run/docs/en/main/file-conventions/entry.server#handleerror
94+
if (request.signal.aborted) {
95+
__DEBUG_BUILD__ && logger.warn('Skipping capture of aborted request');
96+
return;
97+
}
98+
9299
// eslint-disable-next-line @typescript-eslint/no-explicit-any
93100
let normalizedRequest: Record<string, unknown> = request as unknown as any;
94101

0 commit comments

Comments
 (0)