Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle request aborted as bad request (code 400) #49

Open
titarenko opened this issue May 17, 2023 · 0 comments
Open

handle request aborted as bad request (code 400) #49

titarenko opened this issue May 17, 2023 · 0 comments

Comments

@titarenko
Copy link
Owner

POST /rpc/order.save ... failed due to { BadRequestError: request aborted
    at IncomingMessage.onAborted (.../node_modules/raw-body/index.js:231:10)
    at emitNone (events.js:105:13)
    at IncomingMessage.emit (events.js:207:7)
    at abortIncoming (_http_server.js:410:9)
    at socketOnClose (_http_server.js:404:3)
    at emitOne (events.js:120:20)
    at TLSSocket.emit (events.js:210:7)
    at _handle.close (net.js:547:12)
    at Socket.done (_tls_wrap.js:356:7)
    at Object.onceWrapper (events.js:316:30)
    at emitOne (events.js:120:20)
    at Socket.emit (events.js:210:7)
    at TCP._handle.close [as _onclose] (net.js:547:12)
  message: 'request aborted',
  code: 'ECONNABORTED',
  expected: 31331,
  length: 31331,
  received: 0,
  type: 'request.aborted' }
app.use((err, req, res, next) => {
  if (err && err.code === 'ECONNABORTED') {
    res.status(400).end(); // Don't process this error any further to avoid its logging
  } else
    next(err);
});
titarenko added a commit that referenced this issue May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant