Files
Anthias/tests
Viktor Petersson f0c47c0e87 fix(celery): don't report the by-design codec rejection to Sentry
The upload codec/resolution gate raises ``UnsupportedVideoCodecError``
as a deliberate, operator-facing rejection — it's surfaced in the UI as
a "Failed" pill plus a copy-pasteable ffmpeg re-encode recipe via
``_NormalizeAssetTask.on_failure``. It's an expected outcome (e.g. Pi 5
has no H.264 HW decode block, an unknown arm64 board can't certify any
codec), not a fault, so it shouldn't reach Sentry — but every rejection
was landing there as an unhandled task error (Sentry ANTHIAS-1J,
ANTHIAS-20).

List it in the video task's ``throws``: Celery then logs it at INFO
without a traceback, and sentry-sdk's CeleryIntegration skips
``task.throws`` exceptions (``_capture_exception`` returns early on
``isinstance(exc, task.throws)``), so the gate stops flooding Sentry.
``on_failure`` still runs, so the operator-facing error pill and recipe
are unchanged.

Regression test asserts the video task declares it in ``throws`` and the
image task (which never raises it) does not.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 06:39:39 +00:00
..
2019-09-10 14:28:46 +06:00
2019-09-10 14:28:46 +06:00