The errorHandler option that can be supplied to the service broker options has loose type definitions for the info parameter. In one case it is defined as any, and in the other it is defined as GenericObject (i.e. Record<string,any>). The signature of the callers to the errorHandler is variable, but it falls into two distinct categories: when called from the error handler middleware and when called from other broker workflows. These results in two possible types for the info parameter.
This PR updates the type definitions to be more specific about the types for the info parameter for the broker's errorHandler option.
:dart: Relevant issues
None
:gem: Type of change
[X] New feature (non-breaking change which adds functionality)
:vertical_traffic_light: How Has This Been Tested?
I patched these changes into my repository and then created a new error handler function which used the info parameter.
:checkered_flag: Checklist:
[X] My code follows the style guidelines of this project
[X] I have performed a self-review of my own code
[ ] I have added tests that prove my fix is effective or that my feature works
[X] New and existing unit tests pass locally with my changes
[X] I have commented my code, particularly in hard-to-understand areas
:memo: Description
The
errorHandler
option that can be supplied to the service broker options has loose type definitions for theinfo
parameter. In one case it is defined asany
, and in the other it is defined asGenericObject
(i.e.Record<string,any>
). The signature of the callers to theerrorHandler
is variable, but it falls into two distinct categories: when called from the error handler middleware and when called from other broker workflows. These results in two possible types for theinfo
parameter.This PR updates the type definitions to be more specific about the types for the
info
parameter for the broker'serrorHandler
option.:dart: Relevant issues
None
:gem: Type of change
:vertical_traffic_light: How Has This Been Tested?
I patched these changes into my repository and then created a new error handler function which used the
info
parameter.:checkered_flag: Checklist: