2022-05-18 12:58:54 +00:00
|
|
|
from typing import Awaitable, Callable, Optional
|
2022-05-07 21:07:55 +00:00
|
|
|
from app.classes.web.base_api_handler import BaseApiHandler
|
|
|
|
|
|
|
|
|
|
|
|
class ApiNotFoundHandler(BaseApiHandler):
|
2022-05-18 12:58:54 +00:00
|
|
|
def _not_found(self, page: str) -> None:
|
2022-05-07 21:07:55 +00:00
|
|
|
self.finish_json(
|
|
|
|
404,
|
|
|
|
{"status": "error", "error": "API_HANDLER_NOT_FOUND", "page": page},
|
|
|
|
)
|
2022-05-18 12:58:54 +00:00
|
|
|
|
|
|
|
head = _not_found # type: Callable[..., Optional[Awaitable[None]]]
|
|
|
|
get = _not_found # type: Callable[..., Optional[Awaitable[None]]]
|
|
|
|
post = _not_found # type: Callable[..., Optional[Awaitable[None]]]
|
|
|
|
delete = _not_found # type: Callable[..., Optional[Awaitable[None]]]
|
|
|
|
patch = _not_found # type: Callable[..., Optional[Awaitable[None]]]
|
|
|
|
put = _not_found # type: Callable[..., Optional[Awaitable[None]]]
|
|
|
|
options = _not_found # type: Callable[..., Optional[Awaitable[None]]]
|