mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
webhooks: Rename UnexpectedWebhookEventType to UnsupportedWebhookEventType.
Any exception is an "unexpected event", which means talking about having an "unexpected event logger" or "unexpected event exception" is confusing. As the error message in `exceptions.py` already explains, this is about an _unsupported_ event type. This also switches the path that these exceptions are written to, accordingly.
This commit is contained in:
committed by
Tim Abbott
parent
8016769613
commit
9ea9752e0e
@@ -5,7 +5,7 @@ from django.db.models import Q
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.exceptions import UnexpectedWebhookEventType
|
||||
from zerver.lib.exceptions import UnsupportedWebhookEventType
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.lib.webhooks.common import check_send_webhook_message
|
||||
@@ -107,7 +107,7 @@ def api_harbor_webhook(request: HttpRequest, user_profile: UserProfile,
|
||||
content_func = EVENT_FUNCTION_MAPPER.get(event)
|
||||
|
||||
if content_func is None:
|
||||
raise UnexpectedWebhookEventType('Harbor', event)
|
||||
raise UnsupportedWebhookEventType('Harbor', event)
|
||||
|
||||
content: str = content_func(payload, user_profile, operator_username)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user