diff --git a/deno_dist/hono-base.ts b/deno_dist/hono-base.ts index 81f3aa51..faf9ce19 100644 --- a/deno_dist/hono-base.ts +++ b/deno_dist/hono-base.ts @@ -174,12 +174,12 @@ class Hono< return subApp } - onError(handler: ErrorHandler) { + onError = (handler: ErrorHandler) => { this.errorHandler = handler return this } - notFound(handler: NotFoundHandler) { + notFound = (handler: NotFoundHandler) => { this.notFoundHandler = handler return this } diff --git a/src/hono-base.ts b/src/hono-base.ts index b8c0e7a5..c9c30e64 100644 --- a/src/hono-base.ts +++ b/src/hono-base.ts @@ -174,12 +174,12 @@ class Hono< return subApp } - onError(handler: ErrorHandler) { + onError = (handler: ErrorHandler) => { this.errorHandler = handler return this } - notFound(handler: NotFoundHandler) { + notFound = (handler: NotFoundHandler) => { this.notFoundHandler = handler return this }