mirror of
https://github.com/RustyRaptor/doge_cogs.git
synced 2026-12-03 15:55:21 -07:00
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.
19 lines
599 B
Python
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."""
|