this is an exception thrown by raw body that is used by body-parser
from express-docs:
request aborted
This error will occur when the request is aborted by
the client before reading the body has finished. The received property
will be set to the number of bytes received before the request was
aborted and the expected property is set to the number of expected
bytes. The status property is set to 400 and type property is set to
'request.aborted'.
if you want to handle all request thrown from body parser for example
'encoding.unsupported',
'entity.parse.failed',
'entity.verify.failed',
'request.aborted',
'request.size.invalid',
'stream.encoding.set',
'parameters.too.many',
'charset.unsupported',
'encoding.unsupported',
'entity.too.large'
use this middleware
$ npm i express-body-parser-error-handler
and simply put it right after your body-parser initialization
const bodyParserErrorHandler = require('express-body-parser-error-handler')
...
...
application.use(bodyParser.json({ limit: '50mb' }));
application.use(bodyParser.urlencoded({ extended: true, limit: '50mb' }));
application.use(bodyParserErrorHandler());
...