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

adding support for specifying headers in ctx.onerror #429

Closed
dead-horse opened this issue Mar 31, 2015 · 9 comments
Closed

adding support for specifying headers in ctx.onerror #429

dead-horse opened this issue Mar 31, 2015 · 9 comments

Comments

@dead-horse
Copy link
Member

koajs/ratelimit#13

@jonathanong
Copy link
Member

what can't be done with middleware? streaming errors? if anything, i'd prefer the .onerror handler to be configurable.

@cesarandreu
Copy link

+1 to having .onerror configurable

@jonathanong jonathanong modified the milestone: 1.1.0 Aug 22, 2015
@jonathanong jonathanong modified the milestones: 1.2.0, 1.1.0 Oct 11, 2015
@tejasmanohar
Copy link
Member

another +1 for making .onerror configurable

@tejasmanohar
Copy link
Member

@jonathanong what would this look like? would we just extend the onErrors API to allow passing in headers (keys) that should stay in the response this.res._headers? is the end goal for the user to be able to specify what headers should stay, what the values of the headers that stay are, and/or just if headers should be unset or not?

@jonathanong
Copy link
Member

i'm not sure. i'm not sure what the problem reported is

@pensierinmusica
Copy link

At the bare minimum I think the user should be allowed to keep the headers that have been set up to when the error has been thrown if it's a user-level error, as I mentioned here: #537 (comment).

Then, whether this should be a default behavior, or set as an option it's debatable. Imho should be default but other people might think differently.

@felixfbecker
Copy link
Contributor

Related #571

@jonathanong
Copy link
Member

i think i like #571 solution better. if you agree @dead-horse , wanna close this?

otherwise, onerror could be configurable too. technically it should already be configurable - we just need to make it more user-friendly and document it.

@dead-horse
Copy link
Member Author

SGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants