X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=exceptions.py;h=82a82a566b1b1da50af1942364761722c09f047c;hb=36fea7f15ed17150691b5b3ead75450e575229ef;hp=3ce94d365774422252ab591303907d31ff65d1ba;hpb=bf508f86e1576736d18cab08edbca834456045ee;p=python_utils.git diff --git a/exceptions.py b/exceptions.py index 3ce94d3..82a82a5 100644 --- a/exceptions.py +++ b/exceptions.py @@ -1,5 +1,9 @@ #!/usr/bin/env python3 +# This module is commonly used by others in here and should avoid +# taking any unnecessary dependencies back on them. + + class PreconditionException(AssertionError): pass @@ -9,5 +13,8 @@ class PostconditionException(AssertionError): class TimeoutError(Exception): - pass + def __init__(self, value: str = "Timed out"): + self.value = value + def __str__(self): + return repr(self.value)