Title: Error handlers that take args: Args crash with a missing 'next' argument · Issue #1598 · slackapi/bolt-python · GitHub
Open Graph Title: Error handlers that take args: Args crash with a missing 'next' argument · Issue #1598 · slackapi/bolt-python
X Title: Error handlers that take args: Args crash with a missing 'next' argument · Issue #1598 · slackapi/bolt-python
Description: Reproducible in: The slack_bolt version slack_bolt==1.30.0 slack_sdk==3.45.0 Python runtime version Python 3.12.5 OS info macOS 27.0 Steps to reproduce: Register a global error handler that takes args: Args. from slack_bolt import App, A...
Open Graph Description: Reproducible in: The slack_bolt version slack_bolt==1.30.0 slack_sdk==3.45.0 Python runtime version Python 3.12.5 OS info macOS 27.0 Steps to reproduce: Register a global error handler that takes a...
X Description: Reproducible in: The slack_bolt version slack_bolt==1.30.0 slack_sdk==3.45.0 Python runtime version Python 3.12.5 OS info macOS 27.0 Steps to reproduce: Register a global error handler that takes a...
Opengraph URL: https://github.com/slackapi/bolt-python/issues/1598
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error handlers that take args: Args crash with a missing 'next' argument","articleBody":"### Reproducible in:\n\n#### The `slack_bolt` version\n\n```\nslack_bolt==1.30.0\nslack_sdk==3.45.0\n```\n\n#### Python runtime version\n\n```\nPython 3.12.5\n```\n\n#### OS info\n\n```\nmacOS 27.0\n```\n\n#### Steps to reproduce:\n\nRegister a global error handler that takes `args: Args`.\n\n```python\nfrom slack_bolt import App, Args\n\napp = App(token=\"xoxb-...\", signing_secret=\"secret\")\n\n@app.error\ndef on_error(error, args: Args):\n args.logger.error(error)\n\n@app.event(\"app_mention\")\ndef boom(say):\n raise RuntimeError(\"original error\")\n```\n\n1. Trigger the `app_mention` event.\n\n### Expected result:\n\n`on_error` runs and logs `original error`.\n\n### Actual result:\n\nThe error handler itself crashes before it runs:\n\n```\nTypeError: Args.__init__() missing 1 required positional argument: 'next'\n```\n\nThe original `RuntimeError` is lost. In `slack_bolt/kwargs_injection/utils.py` (`build_required_kwargs`) and `async_utils.py`, `next` is removed from the available arguments for error handlers, but `Args(**all_available_args)` is then built from that reduced dict, and `Args` requires `next`. The same code also uses `arg_names.pop()` on the listener's own list, so the list shrinks on every call.\n\nI have a fix with sync and async tests in #1592. It also adds an `error` field to `Args` so error handlers can read the exception through `args`.\n\n## Requirements\n\nI have read the Contributing guidelines and Code of Conduct.\n","author":{"url":"https://github.com/sahiljagtap08","@type":"Person","name":"sahiljagtap08"},"datePublished":"2026-10-09T18:06:03Z","url":"https://github.com/slackapi/bolt-python/issues/1598"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:84a8639b-d326-a896-97b4-4f004fbc656f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C46:C843D:178B65D:1F3E92A:6AFEBCC1 |
| html-safe-nonce | fc2a98d8967a15ff23f906ca43058b0c85fe6cbe349786868d5dcf0d96062a68 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzQ2OkM4NDNEOjE3OEI2NUQ6MUYzRTkyQTo2QUZFQkNDMSIsInZpc2l0b3JfaWQiOiI4MDM4NjQwNzkwNzczMDg3NDI1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c80e97734be6391e305177b8f023e32d65513db2f711bfdb7e386fc3238a7a0e |
| hovercard-subject-tag | issue:5782556763 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/slackapi/bolt-python/1598/issue_layout |
| twitter:image | https://opengraph.githubassets.com/53169bf69a016a8dc10b52cac53b3c66f84122edacbfa3a0f91dec8429cbbc6d/slackapi/bolt-python/issues/1598 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/53169bf69a016a8dc10b52cac53b3c66f84122edacbfa3a0f91dec8429cbbc6d/slackapi/bolt-python/issues/1598 |
| og:image:alt | Reproducible in: The slack_bolt version slack_bolt==1.30.0 slack_sdk==3.45.0 Python runtime version Python 3.12.5 OS info macOS 27.0 Steps to reproduce: Register a global error handler that takes a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sahiljagtap08 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 95b2753c978240785d6cca00783c00a371b2d7d9879bb32e305170a1b19bd28e |
| turbo-cache-control | no-preview |
| go-import | github.com/slackapi/bolt-python git https://github.com/slackapi/bolt-python.git |
| octolytics-dimension-user_id | 6962987 |
| octolytics-dimension-user_login | slackapi |
| octolytics-dimension-repository_id | 268795735 |
| octolytics-dimension-repository_nwo | slackapi/bolt-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 268795735 |
| octolytics-dimension-repository_network_root_nwo | slackapi/bolt-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e1ce4c46d35aa8463a597a1bbffd4f0a456edb38 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width