From 3a454d44ce074b3d03b00719e24abdc9eafdcf99 Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Sat, 2 Apr 2022 19:40:46 +0000 Subject: [PATCH] onreqerror: Do not log aborted "errors" --- flaska.mjs | 6 ++---- package.json | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/flaska.mjs b/flaska.mjs index b3329ba..1d39093 100644 --- a/flaska.mjs +++ b/flaska.mjs @@ -612,12 +612,10 @@ export class Flaska { } } this._onreqerror = function(err, ctx) { - if (err.message === 'aborted') { - ctx.log.info(err) - } else { + if (err.message !== 'aborted') { ctx.log.error(err) + ctx.res.statusCode = ctx.statusCode = 400 } - ctx.res.statusCode = ctx.statusCode = 400 ctx.res.end() } this._onreserror = function(err, ctx) { diff --git a/package.json b/package.json index 5aeac59..8f00ba4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flaska", - "version": "1.2.1", + "version": "1.2.2", "description": "Flaska is a micro web-framework for node. It is designed to be fast, simple and lightweight, and is distributed as a single file module with no dependencies.", "main": "flaska.mjs", "scripts": {