Skip to content

Commit 081946b

Browse files
committed
address PR feedback
1 parent 92884ef commit 081946b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ class Router {
7979
* Registers a custom error handler for specific error types.
8080
*
8181
* @param errorType - The error constructor(s) to handle
82-
* @param handler - The error handler function that returns a Promise<ErrorResponse>
82+
* @param handler - The error handler that returns an
83+
* error response>
8384
*/
8485
public errorHandler<T extends Error>(
8586
errorType: ErrorConstructor<T> | ErrorConstructor<T>[],
@@ -106,7 +107,8 @@ class Router {
106107
/**
107108
* Registers a custom handler for 404 Not Found errors.
108109
*
109-
* @param handler - The error handler function that returns a Promise<ErrorResponse>
110+
* @param handler - The error handler that returns an error
111+
* response
110112
*/
111113
public notFound(handler: ErrorHandler<NotFoundError>): void;
112114
public notFound(): MethodDecorator;
@@ -127,7 +129,7 @@ class Router {
127129
/**
128130
* Registers a custom handler for 405 Method Not Allowed errors.
129131
*
130-
* @param handler - The error handler function that returns a Promise<ErrorResponse>
132+
* @param handler - The error handler that returns an error response
131133
*/
132134
public methodNotAllowed(handler: ErrorHandler<MethodNotAllowedError>): void;
133135
public methodNotAllowed(): MethodDecorator;
@@ -216,7 +218,7 @@ class Router {
216218
context,
217219
request,
218220
// this response should be overwritten by the handler, if it isn't
219-
// it means somthing went wrong with the middleware chain
221+
// it means something went wrong with the middleware chain
220222
res: new Response('', { status: 500 }),
221223
};
222224

0 commit comments

Comments
 (0)