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

Provide a way for plugins to add middlewares to the stack #601

Open
xsawyerx opened this issue Jun 4, 2014 · 1 comment
Open

Provide a way for plugins to add middlewares to the stack #601

xsawyerx opened this issue Jun 4, 2014 · 1 comment

Comments

@xsawyerx
Copy link
Member

xsawyerx commented Jun 4, 2014

In issue #600 we discuss having a Plack::Builder object. Once we figure out the plugin implementation (#599), we should a way in the API to add stuff to that middleware stack.

@dostermeier
Copy link

+1

For a specific example, it would be great if I could register a component that wraps around all requests that can intercept exceptions / errors and do something in response.

Example:

I have a REST API and parts of it will throw validation errors. I would like to have one place that says:

If the exception generated is of type ...Validation, then set status code to 400 and error = some message.

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

2 participants