feat: consolidate custom error handlers #2258
Labels
docs
M-T: Documentation work only
enhancement
M-T: A feature request for new functionality
semver:major
TypeScript-specific
Milestone
Today, bolt allows for two different kinds of error handlers to be defined in an app:
extendedErrorHandler
, and when an error is bubbled up within bolt, depending on the value of this option, different behaviour is triggered for the user-provided error handlerAdditionally, 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.
The text was updated successfully, but these errors were encountered: