1# -*- coding: utf-8 -*-
2
3# Copyright (c) 2025, Brandon Nielsen
4# All rights reserved.
5#
6# This software may be modified and distributed under the terms
7# of the BSD license. See the LICENSE file for details.
8
9
10class ISOFormatError(ValueError):
11 """Raised when ISO 8601 string fails a format check."""
12
13
14class RangeCheckError(ValueError):
15 """Parent type of range check errors."""
16
17
18class YearOutOfBoundsError(RangeCheckError):
19 """Raised when year exceeds limits."""
20
21
22class MonthOutOfBoundsError(RangeCheckError):
23 """Raised when month is outside of 1..12."""
24
25
26class WeekOutOfBoundsError(RangeCheckError):
27 """Raised when week exceeds a year."""
28
29
30class DayOutOfBoundsError(RangeCheckError):
31 """Raised when day is outside of 1..365, 1..366 for leap year."""
32
33
34class HoursOutOfBoundsError(RangeCheckError):
35 """Raise when parsed hours are greater than 24."""
36
37
38class MinutesOutOfBoundsError(RangeCheckError):
39 """Raise when parsed seconds are greater than 60."""
40
41
42class SecondsOutOfBoundsError(RangeCheckError):
43 """Raise when parsed seconds are greater than 60."""
44
45
46class MidnightBoundsError(RangeCheckError):
47 """Raise when parsed time has an hour of 24 but is not midnight."""
48
49
50class LeapSecondError(RangeCheckError):
51 """Raised when attempting to parse a leap second"""