Coverage for typed_stream/exceptions.py: 100%
9 statements
« prev ^ index » next coverage.py v7.6.12, created at 2025-02-12 21:24 +0000
« prev ^ index » next coverage.py v7.6.12, created at 2025-02-12 21:24 +0000
1# Licensed under the EUPL-1.2 or later.
2# You may obtain a copy of the licence in all the official languages of the
3# European Union at https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
5"""Exception classes raised while handling Streams."""
7from __future__ import annotations
9from typing import Literal
11__all__: tuple[
12 Literal["StreamEmptyError"],
13 Literal["StreamFinishedError"],
14 Literal["StreamIndexError"],
15] = ("StreamEmptyError", "StreamFinishedError", "StreamIndexError")
18class StreamFinishedError(ValueError):
19 """You cannot perform operations on a finished Stream."""
21 __slots__ = ()
24class StreamEmptyError(ValueError):
25 """The Stream is empty."""
27 __slots__ = ()
30class StreamIndexError(IndexError):
31 """Stream index out of range."""
33 __slots__ = ()