Coverage for arrakis_server/errors.py: 75.0%

1# Copyright (c) 2025, California Institute of Technology and contributors

2#

3# You should have received a copy of the licensing terms for this

4# software included in the file "LICENSE" located in the top-level

5# directory of this package. If you did not, you can view a copy at

6# https://git.ligo.org/ngdd/arrakis-server/-/raw/main/LICENSE

7

8 from collections.abc import Sequence

9

10 from pyarrow import flight

11

12

13 class TimeRangeUnavailableError(flight.FlightUnavailableError):

14 def __init__(self, start: int, end: int):

15 msg = f"time range requested ({start} - {end}) not available on this server"

16 super().__init__(msg)

17

18

19 class ChannelUnavailableError(flight.FlightUnavailableError):

20 def __init__(self, channels: Sequence[str]):

21 msg = f"channels requested ({channels}) not available on this server"

22 super().__init__(msg)

23

24

25 class RequestUnavailableError(flight.FlightUnavailableError):

26 pass

27

28

29 class RequestCancelledError(flight.FlightCancelledError):

30 pass

31

32

33 class RequestTimedOutError(flight.FlightTimedOutError):

34 pass