diff -r 191c2c1d6e53 -r f479738b4879 iro/error.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/iro/error.py Thu Dec 22 03:13:34 2011 +0100 @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- + +class InterfaceException(Exception): + def __init__(self, code=999, msg="Unbekannter Fehler."): + self.code=code + self.msg=msg + + def dict(self): + return {"code":self.code, + "msg":self.msg, + } + def __str__(self): + return "%i:%s"%(self.code,self.msg) + +class UserNotFound(InterfaceException): + def __init__(self): + InterfaceException.__init__(self, 901, "Der API-Key ist ungültig.") + +class ExternalException(InterfaceException): + def __init__(self): + InterfaceException.__init__(self, 950, "Fehler in externer API.") + +class ValidateException(Exception): + pass