Skip to content

Commit aef81b5

Browse files
committed
Added docstrings about override in the router and error handlers as well
1 parent 2eac09d commit aef81b5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

packages/event-handler/src/rest/ErrorHandlerRegistry.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ export class ErrorHandlerRegistry {
7676
* Merges another {@link ErrorHandlerRegistry | `ErrorHandlerRegistry`} instance into the current instance.
7777
* It takes the handlers from the provided registry and adds them to the current registry.
7878
*
79+
* Error handlers from the included router are merged with existing handlers. If handlers for the same error type exist in both routers, the included router's handler takes precedence.
80+
*
7981
* @param errorHandlerRegistry - The registry instance to merge with the current instance
8082
*/
8183
public merge(errorHandlerRegistry: ErrorHandlerRegistry): void {

packages/event-handler/src/rest/RouteHandlerRegistry.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ class RouteHandlerRegistry {
202202
* Merges another {@link RouteHandlerRegistry | `RouteHandlerRegistry`} instance into the current instance.
203203
* It takes the static and dynamic routes from the provided registry and adds them to the current registry.
204204
*
205+
* Routes from the included router are added to the current router's registry. If a route with the same method and path already exists, the included router's route takes precedence.
206+
*
205207
* @param routeHandlerRegistry - The registry instance to merge with the current instance
206208
* @param options - Configuration options for merging the router
207209
* @param options.prefix - An optional prefix to be added to the paths defined in the router

0 commit comments

Comments
 (0)