File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { getEnv, init } from './utils/env.server.ts'
13
13
import { getInstanceInfo } from './utils/litefs.server.ts'
14
14
import { NonceProvider } from './utils/nonce-provider.ts'
15
15
import { makeTimings } from './utils/timing.server.ts'
16
+ import chalk from 'chalk'
16
17
17
18
const ABORT_DELAY = 5000
18
19
@@ -97,9 +98,16 @@ export function handleError(
97
98
error : unknown ,
98
99
{ request } : LoaderFunctionArgs | ActionFunctionArgs ,
99
100
) : void {
101
+ // Skip capturing if the request is aborted as Remix docs suggest
102
+ // Ref: https://remix.run/docs/en/main/file-conventions/entry.server#handleerror
103
+ if ( request . signal . aborted ) {
104
+ return
105
+ }
100
106
if ( error instanceof Error ) {
107
+ console . error ( chalk . red ( error . stack ) )
101
108
Sentry . captureRemixServerException ( error , 'remix.server' , request )
102
109
} else {
110
+ console . error ( chalk . red ( error ) )
103
111
Sentry . captureException ( error )
104
112
}
105
113
}
You can’t perform that action at this time.
0 commit comments