diff options
Diffstat (limited to '')
| -rw-r--r-- | webmentions_ssg/tasks/receiver.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/webmentions_ssg/tasks/receiver.py b/webmentions_ssg/tasks/receiver.py index bed923c..9073930 100644 --- a/webmentions_ssg/tasks/receiver.py +++ b/webmentions_ssg/tasks/receiver.py @@ -63,16 +63,16 @@ def fetch_source(source_url: str) -> tuple[httpx.Response, bytes]: ) as client, client.stream("GET", source_url) as response, ): - match response.status_code: - case 200: - pass - case 410: - raise SourceGoneError("Source returned HTTP 410") - case status: - if is_temporary_status(status): - raise TemporaryFetchError(f"Source returned HTTP {status}") - else: - raise VerificationError(f"Source returned HTTP {status}") + if response.status_code == 200: + pass + elif response.status_code == 410: + raise SourceGoneError("Source returned HTTP 410") + elif is_temporary_status(response.status_code): + raise TemporaryFetchError( + f"Source returned HTTP {response.status_code}" + ) + else: + raise VerificationError(f"Source returned HTTP {response.status_code}") try: return response, read_limited_body( |
