mirror of
https://github.com/bsedin/matrix-webhook.git
synced 2026-04-09 11:25:40 +00:00
error_map: default to 500
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"""Matrix Webhook utils."""
|
||||
|
||||
import logging
|
||||
from collections import defaultdict
|
||||
from http import HTTPStatus
|
||||
|
||||
from aiohttp import web
|
||||
@@ -10,10 +11,13 @@ from nio.responses import JoinError, RoomSendError
|
||||
|
||||
from . import conf
|
||||
|
||||
ERROR_MAP = {
|
||||
ERROR_MAP = defaultdict(
|
||||
lambda: HTTPStatus.INTERNAL_SERVER_ERROR,
|
||||
{
|
||||
"M_FORBIDDEN": HTTPStatus.FORBIDDEN,
|
||||
"M_CONSENT_NOT_GIVEN": HTTPStatus.FORBIDDEN,
|
||||
}
|
||||
},
|
||||
)
|
||||
LOGGER = logging.getLogger("matrix_webhook.utils")
|
||||
CLIENT = AsyncClient(conf.MATRIX_URL, conf.MATRIX_ID)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user