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:
Alex Vandiver
2020-08-19 13:26:38 -07:00
committed by Tim Abbott
parent 8016769613
commit 9ea9752e0e
33 changed files with 95 additions and 95 deletions

View File

@@ -4,7 +4,7 @@ from typing import Any, Callable, Dict, Optional
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 (
@@ -197,7 +197,7 @@ def gogs_webhook_main(integration_name: str, http_header_name: str,
)
else:
raise UnexpectedWebhookEventType('Gogs', event)
raise UnsupportedWebhookEventType('Gogs', event)
check_send_webhook_message(request, user_profile, topic, body)
return json_success()