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

Enable developers to customize the way to handle unmatched requests #719

Closed
1 of 6 tasks
seratch opened this issue Mar 29, 2021 · 1 comment · Fixed by #741
Closed
1 of 6 tasks

Enable developers to customize the way to handle unmatched requests #719

seratch opened this issue Mar 29, 2021 · 1 comment · Fixed by #741
Assignees
Labels
enhancement M-T: A feature request for new functionality project:bolt
Milestone

Comments

@seratch
Copy link
Member

seratch commented Mar 29, 2021

Currently, there is no way to customize the behavior of App when an incoming request does not match with any listeners in the app. To improve this, we can extract these lines of code as a default behavior and enable developers to override the function in some way.

As we already have methods like oauth*Error, I'm thinking to name the new method as unhandledRequestError or something like that I went with unmatchedRequestHandler in AppConfig

Unlike other Bolt frameworks (JS / Python), Bolt for Java relays runtime exceptions to the external layer like Bolt adapters and its runtime. If a developer would like to handle the unmatched patterns in a single error handler, the recommended way is to throw an exception in the unhandledRequestError (the name is work in progress) method. I went with unmatchedRequestHandler in AppConfig

See also:

Category (place an x in each of the [ ])

  • bolt (Bolt for Java)
  • bolt-{sub modules} (Bolt for Java - optional modules)
  • slack-api-client (Slack API Clients)
  • slack-api-model (Slack API Data Models)
  • slack-api-*-kotlin-extension (Kotlin Extensions for Slack API Clients)
  • slack-app-backend (The primitive layer of Bolt for Java)
@seratch seratch added enhancement M-T: A feature request for new functionality project:bolt labels Mar 29, 2021
@seratch seratch self-assigned this Mar 29, 2021
@seratch seratch added this to the 1.8.0 milestone Mar 29, 2021
@seratch
Copy link
Member Author

seratch commented May 6, 2021

In this improvement, we can add something similar to slackapi/bolt-python#323 too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality project:bolt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant