From 96946bad8e02d90f817eb59e27a084e7790a459a Mon Sep 17 00:00:00 2001 From: Yusuke Wada Date: Thu, 21 Dec 2023 22:37:56 +0900 Subject: [PATCH] fix(hono-base): make `onError` and `notFound` as class field (#1839) * fix(hono-base): make `onError` and `notFound` as class field * denoify --- deno_dist/hono-base.ts | 4 ++-- src/hono-base.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 }