/ letsencrypt / errors.py
errors.py
1 """Let's Encrypt client errors.""" 2 3 4 class Error(Exception): 5 """Generic Let's Encrypt client error.""" 6 7 8 class AccountStorageError(Error): 9 """Generic `.AccountStorage` error.""" 10 11 12 class AccountNotFound(AccountStorageError): 13 """Account not found error.""" 14 15 16 class ReverterError(Error): 17 """Let's Encrypt Reverter error.""" 18 19 20 class SubprocessError(Error): 21 """Subprocess handling error.""" 22 23 24 class CertStorageError(Error): 25 """Generic `.CertStorage` error.""" 26 27 28 # Auth Handler Errors 29 class AuthorizationError(Error): 30 """Authorization error.""" 31 32 33 class FailedChallenges(AuthorizationError): 34 """Failed challenges error. 35 36 :ivar set failed_achalls: Failed `.AnnotatedChallenge` instances. 37 38 """ 39 def __init__(self, failed_achalls): 40 assert failed_achalls 41 self.failed_achalls = failed_achalls 42 super(FailedChallenges, self).__init__() 43 44 def __str__(self): 45 return "Failed authorization procedure. {0}".format( 46 ", ".join( 47 "{0} ({1}): {2}".format(achall.domain, achall.typ, achall.error) 48 for achall in self.failed_achalls if achall.error is not None)) 49 50 51 class ContAuthError(AuthorizationError): 52 """Let's Encrypt Continuity Authenticator error.""" 53 54 55 class DvAuthError(AuthorizationError): 56 """Let's Encrypt DV Authenticator error.""" 57 58 59 # Authenticator - Challenge specific errors 60 class DvsniError(DvAuthError): 61 """Let's Encrypt DVSNI error.""" 62 63 64 # Plugin Errors 65 class PluginError(Error): 66 """Let's Encrypt Plugin error.""" 67 68 69 class PluginSelectionError(Error): 70 """A problem with plugin/configurator selection or setup""" 71 72 73 class NoInstallationError(PluginError): 74 """Let's Encrypt No Installation error.""" 75 76 77 class MisconfigurationError(PluginError): 78 """Let's Encrypt Misconfiguration error.""" 79 80 81 class NotSupportedError(PluginError): 82 """Let's Encrypt Plugin function not supported error.""" 83 84 85 class RevokerError(Error): 86 """Let's Encrypt Revoker error.""" 87 88 89 class StandaloneBindError(Error): 90 """Standalone plugin bind error.""" 91 92 def __init__(self, socket_error, port): 93 super(StandaloneBindError, self).__init__( 94 "Problem binding to port {0}: {1}".format(port, socket_error)) 95 self.socket_error = socket_error 96 self.port = port