X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=exceptions.py;h=bd499886221ba55e044a739e835fdc4af8c98c6e;hb=532df2c5b57c7517dfb3dddd8c1358fbadf8baf3;hp=82a82a566b1b1da50af1942364761722c09f047c;hpb=36fea7f15ed17150691b5b3ead75450e575229ef;p=python_utils.git diff --git a/exceptions.py b/exceptions.py index 82a82a5..bd49988 100644 --- a/exceptions.py +++ b/exceptions.py @@ -1,19 +1,30 @@ #!/usr/bin/env python3 +# © Copyright 2021-2022, Scott Gasch + +"""Some exceptions used elsewhere.""" + # This module is commonly used by others in here and should avoid # taking any unnecessary dependencies back on them. class PreconditionException(AssertionError): + """Use to indicate function preconditions violated.""" + pass class PostconditionException(AssertionError): + """Use to indicate function postconditions violated.""" + pass class TimeoutError(Exception): + """Use to indicate an operation that timed out.""" + def __init__(self, value: str = "Timed out"): + super().__init__() self.value = value def __str__(self):