aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/tasks/sender.py
diff options
context:
space:
mode:
Diffstat (limited to 'webmentions_ssg/tasks/sender.py')
-rw-r--r--webmentions_ssg/tasks/sender.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/webmentions_ssg/tasks/sender.py b/webmentions_ssg/tasks/sender.py
index db99476..cd6c64a 100644
--- a/webmentions_ssg/tasks/sender.py
+++ b/webmentions_ssg/tasks/sender.py
@@ -210,10 +210,8 @@ def send_webmention_task(webmention_uuid: uuid.UUID) -> None:
httpx.InvalidURL,
httpx.UnsupportedProtocol,
httpx.LocalProtocolError,
- ValueError,
- UnicodeError,
) as exc:
- # Invalid URLs and local protocol errors cannot improve with retries.
+ # Known permanent failures cannot improve with retries.
outcome = SentWebmentionStatus.FAILED
reason = str(exc) or type(exc).__name__
except (TemporarySenderError, AddressResolutionError, httpx.RequestError) as exc:
@@ -221,6 +219,14 @@ def send_webmention_task(webmention_uuid: uuid.UUID) -> None:
reason = str(exc) or "Webmention request failed"
terminal = attempt >= max_attempts
temporary_failure = True
+ except Exception as exc:
+ # Unexpected errors must not disappear into a generic permanent-failure
+ # handler without a traceback (including programming ValueErrors).
+ current_app.logger.exception(
+ "Unexpected error sending SentWebmention %s", webmention_uuid
+ )
+ outcome = SentWebmentionStatus.FAILED
+ reason = str(exc) or type(exc).__name__
# A scanner may have reopened or superseded the revision during I/O.
# Refresh only once, and persist one outcome atomically with its metadata.