mirror of
https://github.com/honojs/hono.git
synced 2024-11-29 17:46:30 +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:
parent
a1c7144d26
commit
96946bad8e
@ -174,12 +174,12 @@ class Hono<
|
||||
return subApp
|
||||
}
|
||||
|
||||
onError(handler: ErrorHandler<E>) {
|
||||
onError = (handler: ErrorHandler<E>) => {
|
||||
this.errorHandler = handler
|
||||
return this
|
||||
}
|
||||
|
||||
notFound(handler: NotFoundHandler<E>) {
|
||||
notFound = (handler: NotFoundHandler<E>) => {
|
||||
this.notFoundHandler = handler
|
||||
return this
|
||||
}
|
||||
|
@ -174,12 +174,12 @@ class Hono<
|
||||
return subApp
|
||||
}
|
||||
|
||||
onError(handler: ErrorHandler<E>) {
|
||||
onError = (handler: ErrorHandler<E>) => {
|
||||
this.errorHandler = handler
|
||||
return this
|
||||
}
|
||||
|
||||
notFound(handler: NotFoundHandler<E>) {
|
||||
notFound = (handler: NotFoundHandler<E>) => {
|
||||
this.notFoundHandler = handler
|
||||
return this
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user