If an incoming request does not match with any listeners in a Bolt app, the Bolt app responds to the request with 404 response status. The following lines of code are relevant parts in App / AsyncApp:
There is no way to append custom logic for the patterns. A common use case can be to customize the logging in the scenario.
To improve this, I'm thinking to change the behavior as below:
- Add a new Bolt specific exception
BoltUnhandledRequestError(BoltError) here and enable @app.error listener to handle the pattern
- Change
App / AsyncApp internals. If a request is unhandled, App/AsncApp raises BoltUnhandledRequestError and lets @app.error listener handle it. If @app.error listener does not return any BoltResponse or set status to the response argument, App/AsncApp falls back to the current logic, which outputs simple log message and returns 404 status anyway.
- As with the current implementation, non-200 responses are ignored in Socket Mode
If there is no concern about this change, we'll apply the change in the next minor version (1.5.0).
Category (place an x in each of the [ ])
Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
If an incoming request does not match with any listeners in a Bolt app, the Bolt app responds to the request with 404 response status. The following lines of code are relevant parts in
App/AsyncApp:There is no way to append custom logic for the patterns. A common use case can be to customize the logging in the scenario.
To improve this, I'm thinking to change the behavior as below:
BoltUnhandledRequestError(BoltError)here and enable@app.errorlistener to handle the patternApp/AsyncAppinternals. If a request is unhandled,App/AsncAppraisesBoltUnhandledRequestErrorand lets@app.errorlistener handle it. If@app.errorlistener does not return anyBoltResponseor set status to theresponseargument,App/AsncAppfalls back to the current logic, which outputs simple log message and returns 404 status anyway.If there is no concern about this change, we'll apply the change in the next minor version (1.5.0).
Category (place an
xin each of the[ ])Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.