Skip to content

Commit 975679d

Browse files
committed
fix: update exceptionHandler method signature for improved type handling
1 parent 73eeb77 commit 975679d

File tree

1 file changed

+8
-8
lines changed
  • packages/event-handler/src/appsync-graphql

1 file changed

+8
-8
lines changed

packages/event-handler/src/appsync-graphql/Router.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,16 +1023,16 @@ class Router {
10231023
* @param errorClass - The error class to handle.
10241024
* @param handler - The handler function to be called when the error is caught.
10251025
*/
1026-
public exceptionHandler<TError extends Error>(
1027-
error: ErrorClass<TError>,
1028-
handler: ExceptionHandler<TError>
1026+
public exceptionHandler<T extends Error>(
1027+
error: ErrorClass<T>,
1028+
handler: ExceptionHandler<T>
10291029
): void;
1030-
public exceptionHandler<TError extends Error>(
1031-
error: ErrorClass<TError>
1030+
public exceptionHandler<T extends Error>(
1031+
error: ErrorClass<T>
10321032
): MethodDecorator;
1033-
public exceptionHandler<TError extends Error>(
1034-
error: ErrorClass<TError>,
1035-
handler?: ExceptionHandler<TError>
1033+
public exceptionHandler<T extends Error>(
1034+
error: ErrorClass<T>,
1035+
handler?: ExceptionHandler<T>
10361036
): MethodDecorator | undefined {
10371037
if (typeof handler === 'function') {
10381038
this.exceptionHandlerRegistry.register({

0 commit comments

Comments
 (0)