ruff: Fix N818 exception name should be named with an Error suffix.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2022-11-17 00:30:48 -08:00
committed by Tim Abbott
parent eb2c822d3f
commit 73c4da7974
110 changed files with 507 additions and 507 deletions

View File

@@ -5,7 +5,7 @@ from django.db.models import Q
from django.http import HttpRequest, HttpResponse
from zerver.decorator import webhook_view
from zerver.lib.exceptions import UnsupportedWebhookEventType
from zerver.lib.exceptions import UnsupportedWebhookEventTypeError
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
from zerver.lib.validator import WildValue, check_int, check_string, to_wild_value
@@ -59,7 +59,7 @@ def handle_scanning_completed_event(
scan_results = ""
scan_overview = payload["event_data"]["resources"][0]["scan_overview"]
if "application/vnd.security.vulnerability.report; version=1.1" not in scan_overview:
raise UnsupportedWebhookEventType("Unsupported harbor scanning webhook payload")
raise UnsupportedWebhookEventTypeError("Unsupported harbor scanning webhook payload")
scan_summaries = scan_overview["application/vnd.security.vulnerability.report; version=1.1"][
"summary"
]["summary"]
@@ -109,7 +109,7 @@ def api_harbor_webhook(
content_func = EVENT_FUNCTION_MAPPER.get(event)
if content_func is None:
raise UnsupportedWebhookEventType(event)
raise UnsupportedWebhookEventTypeError(event)
content: str = content_func(payload, user_profile, operator_username)