Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/aniso8601/exceptions.py: 92%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

12 statements  

1# -*- coding: utf-8 -*- 

2 

3# Copyright (c) 2026, Brandon Nielsen 

4# SPDX-License-Identifier: BSD-3-Clause 

5 

6 

7class ISOFormatError(ValueError): 

8 """Raised when ISO 8601 string fails a format check.""" 

9 

10 

11class RangeCheckError(ValueError): 

12 """Parent type of range check errors.""" 

13 

14 

15class YearOutOfBoundsError(RangeCheckError): 

16 """Raised when year exceeds limits.""" 

17 

18 

19class MonthOutOfBoundsError(RangeCheckError): 

20 """Raised when month is outside of 1..12.""" 

21 

22 

23class WeekOutOfBoundsError(RangeCheckError): 

24 """Raised when week exceeds a year.""" 

25 

26 

27class DayOutOfBoundsError(RangeCheckError): 

28 """Raised when day is outside of 1..365, 1..366 for leap year.""" 

29 

30 

31class HoursOutOfBoundsError(RangeCheckError): 

32 """Raise when parsed hours are greater than 24.""" 

33 

34 

35class MinutesOutOfBoundsError(RangeCheckError): 

36 """Raise when parsed seconds are greater than 60.""" 

37 

38 

39class SecondsOutOfBoundsError(RangeCheckError): 

40 """Raise when parsed seconds are greater than 60.""" 

41 

42 

43class MidnightBoundsError(RangeCheckError): 

44 """Raise when parsed time has an hour of 24 but is not midnight.""" 

45 

46 

47class LeapSecondError(RangeCheckError): 

48 """Raised when attempting to parse a leap second"""