X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=t%2Fmoe%2F__init__.py;h=63ca9b65108c95a7fc957e8fff77706427ec664e;hb=a249fb797c925052e3ad692d887eb2004d66c455;hp=19957e28a55f8fec2c2f4c73a1ddcbcd06ae77ad;hpb=f9b0b2c89eca1c93e70e80c8c7f7775a65fdccbb;p=moe.git diff --git a/t/moe/__init__.py b/t/moe/__init__.py index 19957e2..63ca9b6 100644 --- a/t/moe/__init__.py +++ b/t/moe/__init__.py @@ -1,7 +1,19 @@ # No initialization needed -class MoeErr(Exception): +class MoeError(Exception): pass -class SolutionErr(Exception): +class SolutionError(Exception): + + def __init__(self, message, stat_code=None): + self.stat_code = stat_code + self.message = message + + def __str__(self): + if self.stat_code is None: + return self.message + else: + return "%s: %s" % (self.stat_code, self.message) + +class TestError(SolutionError): pass