PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` """ class for exceptions used in the other Yubico modules All exceptions raised by the different Yubico modules are inherited from the base class YubicoError. That means you can trap them all, without knowing the details, with code like this : try: # something Yubico related except yubico.yubico_exception.YubicoError as inst: print "ERROR: %s" % inst.reason """ # Copyright (c) 2010, Yubico AB # See the file COPYING for licence statement. __all__ = [ # constants # functions # classes 'YubicoError', 'InputError', 'YubiKeyTimeout', ] from yubico import __version__ class YubicoError(Exception): """ Base class for Yubico exceptions in the yubico package. Attributes: reason -- explanation of the error """ def __init__(self, reason): self.reason = reason def __str__(self): return '<%s instance at %s: %s>' % ( self.__class__.__name__, hex(id(self)), self.reason ) pass class InputError(YubicoError): """ Exception raised for errors in an input to some function. """ def __init__(self, reason='input validation error'): YubicoError.__init__(self, reason)