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:
parent
a1c7144d26
commit
96946bad8e
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user