0
0
mirror of https://github.com/honojs/hono.git synced 2024-12-01 11:51:01 +01:00

fix(hono-base): make onError and notFound as class field (#1839)

* fix(hono-base): make `onError` and `notFound` as class field

* denoify
This commit is contained in:
Yusuke Wada 2023-12-21 22:37:56 +09:00 committed by GitHub
parent a1c7144d26
commit 96946bad8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -174,12 +174,12 @@ class Hono<
return subApp return subApp
} }
onError(handler: ErrorHandler<E>) { onError = (handler: ErrorHandler<E>) => {
this.errorHandler = handler this.errorHandler = handler
return this return this
} }
notFound(handler: NotFoundHandler<E>) { notFound = (handler: NotFoundHandler<E>) => {
this.notFoundHandler = handler this.notFoundHandler = handler
return this return this
} }

View File

@ -174,12 +174,12 @@ class Hono<
return subApp return subApp
} }
onError(handler: ErrorHandler<E>) { onError = (handler: ErrorHandler<E>) => {
this.errorHandler = handler this.errorHandler = handler
return this return this
} }
notFound(handler: NotFoundHandler<E>) { notFound = (handler: NotFoundHandler<E>) => {
this.notFoundHandler = handler this.notFoundHandler = handler
return this return this
} }