We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7513391 commit f7957caCopy full SHA for f7957ca
src/core/exception/exception.filter.ts
@@ -24,8 +24,15 @@ export class ExceptionFilter implements IExceptionFilter {
24
) {}
25
26
async catch(exception: Error, args: ArgumentsHost) {
27
- if (exception && (exception as any).type === 'request.aborted') {
28
- this.logger.warning('Request aborted');
+ // Ignore aborted requests
+ if (
29
+ (exception as any).code === 'ECONNRESET' ||
30
+ // There is some false positive with @fastify/compress and aborted requests
31
+ (exception as any).code === 'ERR_STREAM_PREMATURE_CLOSE'
32
+ ) {
33
+ if (process.env.NODE_ENV !== 'production') {
34
+ this.logger.warning('Request aborted');
35
+ }
36
return;
37
}
38
0 commit comments