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

Adds an onFailure callback to delegate error handling to the app #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jasonmit
Copy link

This adds an onFailure hook that can be passed into the fastboot middleware.

The use case is apps may already have a way of handling errors. This allows someone to inject their own handler logic, which could be as simple as next(err) to allow their apps error handler to take over.

@tomdale
Copy link
Contributor

tomdale commented Jun 24, 2016

Rather than introducing a new callback, I think (in the interests of Express ecosystem consistency) we should consider copying the fallthrough API from express.static().

@jasonmit
Copy link
Author

Sounds great, what should I default to?

@tomdale
Copy link
Contributor

tomdale commented Jun 29, 2016

static() defaults to true, but I think that probably gets used standalone less than FastBoot. false would preserve our current semantics, which IMO are correct, but I'm open to hearing from others who disagree.

@arjansingh
Copy link
Contributor

we can probably close this now that #11 is merged.

@jasonmit
Copy link
Author

I believe what I'm after is slightly different, I want to delegate error handling entirely to the caller.

In #11 it looks like it res.send with html in some cases which might conflict with whatever the error handler is doing.

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

Successfully merging this pull request may close these issues.

3 participants