slackapi / slackapi/bolt-js

feat: consolidate custom error handlers

Open
#2,258 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs enhancement semver:major TypeScript-specific
Dominant language
TypeScript
Stars
2.9k
Forks
445
Avg merge
1d 3h
Merged PRs (30d)
28

Description

Today, bolt allows for two different kinds of error handlers to be defined in an app:

Additionally, this distinction is not documented in our main docs about error handling: https://slack.dev/bolt-js/concepts/error-handling - so the two different kinds of error handlers is a semi-secret. However, it is part of the public API.

I suggest consolidating this: all error handlers are extended error handlers, so any defined error handlers have available to them all the arguments of an extended error handler. A 'simple' error handler can choose not to use the extended error handler properties (and only read from the error object itself).

I think it simplifies the code and API surface area.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked sections in src/App.ts, especially the error-handler types, constructor option, bubbling behavior, and overload area. Review the related cases in src/App-built-in-middleware.spec.ts and the error-handling documentation to understand the current distinction. Done should include the consolidated public API, updated tests without the current type-casting pattern, and documentation covering the resulting behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design, documentation
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.