"""The failures the download pipeline raises itself, with the whole story in the message. `ffmpeg failed (1): …`, `yt-dlp produced no output file`, a post that shows no video: the message says what happened, and the stack is only the `except` that caught it. A failure line leaves that stack off (`pipeline._failure_stack`) — but ONLY for these. A plain `RuntimeError` is also what Python raises for a bug of ours (a dict changed size during iteration, a generator's StopIteration, `RecursionError`, `NotImplementedError`), and that one's stack is the only lead. """ class StatedFailure(RuntimeError): """A failure we raised on purpose, whose message is its full explanation. A `RuntimeError` so every `except RuntimeError` that caught these before still does."""