1from datetime import timedelta 2 3 4class MesaCIException(Exception): 5 pass 6 7 8class MesaCIRetriableException(MesaCIException): 9 pass 10 11 12class MesaCITimeoutError(MesaCIRetriableException): 13 def __init__(self, *args, timeout_duration: timedelta) -> None: 14 super().__init__(*args) 15 self.timeout_duration = timeout_duration 16 17 18class MesaCIRetryError(MesaCIRetriableException): 19 def __init__(self, *args, retry_count: int, last_job: None) -> None: 20 super().__init__(*args) 21 self.retry_count = retry_count 22 self.last_job = last_job 23 24 25class MesaCIFatalException(MesaCIException): 26 """Exception raised when the Mesa CI script encounters a fatal error that 27 prevents the script from continuing.""" 28 29 def __init__(self, *args) -> None: 30 super().__init__(*args) 31 32 33class MesaCIParseException(MesaCIRetriableException): 34 pass 35 36 37class MesaCIKnownIssueException(MesaCIRetriableException): 38 """Exception raised when the Mesa CI script finds something in the logs that 39 is known to cause the LAVA job to eventually fail""" 40 41 pass 42