Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Error: Returning from a request handler without responding or attaching an abort handler is forbidden!#45

Answeredbyghost
andymans asked this question inQ&A
Discussion options

This server is excellent under many circumstances.
But when, as part of the request handling, we need to wait for 'something else' to happen, I see some odd behaviour.

e.g. request arrives and we need to fetch some data before responding:

get('/my-stuff', (res, req) => {   db.query('select * from some_table', (err, reply) => {        res.end(reply)})

or request arrives and we need to call out to an external service in order to satisfy it:

get('/auth/twitter', (res, req) => {   twitterOauth.getRequestToken( (err, token, tokenSecret, results) => {        if (err) {            res.end('oops - we could not fetch a token for you')        } else {             res.end('append this token to your url')       }    })})

At this point the server reports: "Error: Returning from a request handler without responding or attaching an abort handler is forbidden!"

That's pretty interesting. Any ideas how to fix? (nb this may well be 'me' being supremely dopey!)

You must be logged in to vote
Answered by ghostFeb 1, 2019

Error: Returning from a request handler without responding or attaching an abort handler is forbidden!

You are returning from a request handler without responding. So did you attach an abort handler like it tells you to?

examples/VideoStreamer.js

Replies: 3 comments 1 reply

Comment options

Error: Returning from a request handler without responding or attaching an abort handler is forbidden!

You are returning from a request handler without responding. So did you attach an abort handler like it tells you to?

examples/VideoStreamer.js

You must be logged in to vote
1 reply
@kvalood
Comment options

examples/AsyncFunction.js That's right?

Answer selected
Comment options

Good info. Thx.

You must be logged in to vote
0 replies
Comment options

It's a good idea to document this behavior.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
3 participants
@andymans@kvalood@s0kil
Converted from issue

This discussion was converted from issue #45 on December 09, 2020 11:51.


[8]ページ先頭

©2009-2025 Movatter.jp