Files
doge_cogs/watch/errors.py
T
Ziad Arafat 827ae9db2c Say why media-preload refused a watch request
A 400 from the preload API used to fall into the download-status path, so a
season that is not in the library yet looked like "the command doesn't
work" (She-Ra season 3 on 2026-12-01). Problem responses now raise
PreloadRefusedError and the cog replies with the service's own reason
before adding download context.
2026-12-01 00:22:19 -07:00

19 lines
599 B
Python

"""Shared sanitized errors for media service and season requests."""
class PreloadError(Exception):
"""A media service refused or failed a call."""
class PreloadRefusedError(PreloadError):
"""The media service answered with a problem and said why.
The message is the service's own text, e.g. "nothing to cache for a
series with those options", so it belongs in the reply to the person
who asked rather than in a generic failure.
"""
class SeasonError(ValueError):
"""A season change cannot proceed under the selected retention plan."""