Coverage for arrakis_server/errors.py: 75.0%

16 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-08-12 16:39 -0700

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 

8from collections.abc import Sequence 

9 

10from pyarrow import flight 

11 

12 

13class 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 

19class 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 

25class RequestUnavailableError(flight.FlightUnavailableError): 

26 pass 

27 

28 

29class RequestCancelledError(flight.FlightCancelledError): 

30 pass 

31 

32 

33class RequestTimedOutError(flight.FlightTimedOutError): 

34 pass