Exception: Acme::Client::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Acme::Client::Error
- Defined in:
- lib/acme/client/error.rb
Direct Known Subclasses
Defined Under Namespace
Classes: AccountDoesNotExist, AlreadyReplaced, AlreadyRevoked, AutoRenewalCanceled, AutoRenewalCancellationInvalid, AutoRenewalExpired, AutoRenewalRevocationNotSupported, BadAttestationStatement, BadCSR, BadNonce, BadPublicKey, BadRevocationReason, BadSignatureAlgorithm, Caa, CertificateNotReady, ClientError, Compound, Connection, Dns, ExternalAccountRequired, ForcedChainNotFound, IncorrectResponse, InvalidContact, InvalidDirectory, Malformed, NotFound, OnionCAARequired, OrderNotReady, OrderUrlNil, RateLimited, RejectedIdentifier, ServerError, ServerInternal, Subproblem, Timeout, Tls, Unauthorized, UnknownDelegation, UnsupportedChallengeType, UnsupportedContact, UnsupportedIdentifier, UnsupportedOperation, UserActionRequired
Constant Summary collapse
- ACME_ERRORS =
{ 'urn:ietf:params:acme:error:alreadyReplaced' => AlreadyReplaced, 'urn:ietf:params:acme:error:alreadyRevoked' => AlreadyRevoked, 'urn:ietf:params:acme:error:badCSR' => BadCSR, 'urn:ietf:params:acme:error:badNonce' => BadNonce, 'urn:ietf:params:acme:error:badPublicKey' => BadPublicKey, 'urn:ietf:params:acme:error:badSignatureAlgorithm' => BadSignatureAlgorithm, 'urn:ietf:params:acme:error:invalidContact' => InvalidContact, 'urn:ietf:params:acme:error:unsupportedContact' => UnsupportedContact, 'urn:ietf:params:acme:error:externalAccountRequired' => ExternalAccountRequired, 'urn:ietf:params:acme:error:accountDoesNotExist' => AccountDoesNotExist, 'urn:ietf:params:acme:error:malformed' => Malformed, 'urn:ietf:params:acme:error:orderNotReady' => OrderNotReady, 'urn:ietf:params:acme:error:rateLimited' => RateLimited, 'urn:ietf:params:acme:error:rejectedIdentifier' => RejectedIdentifier, 'urn:ietf:params:acme:error:serverInternal' => ServerInternal, 'urn:ietf:params:acme:error:unauthorized' => Unauthorized, 'urn:ietf:params:acme:error:unsupportedIdentifier' => UnsupportedIdentifier, 'urn:ietf:params:acme:error:userActionRequired' => UserActionRequired, 'urn:ietf:params:acme:error:badRevocationReason' => BadRevocationReason, 'urn:ietf:params:acme:error:caa' => Caa, 'urn:ietf:params:acme:error:compound' => Compound, 'urn:ietf:params:acme:error:dns' => Dns, 'urn:ietf:params:acme:error:connection' => Connection, 'urn:ietf:params:acme:error:tls' => Tls, 'urn:ietf:params:acme:error:incorrectResponse' => IncorrectResponse, 'urn:ietf:params:acme:error:autoRenewalCanceled' => AutoRenewalCanceled, 'urn:ietf:params:acme:error:autoRenewalExpired' => AutoRenewalExpired, 'urn:ietf:params:acme:error:autoRenewalCancellationInvalid' => AutoRenewalCancellationInvalid, 'urn:ietf:params:acme:error:autoRenewalRevocationNotSupported' => AutoRenewalRevocationNotSupported, 'urn:ietf:params:acme:error:unknownDelegation' => UnknownDelegation, 'urn:ietf:params:acme:error:onionCAARequired' => OnionCAARequired, 'urn:ietf:params:acme:error:badAttestationStatement' => BadAttestationStatement, }
Instance Attribute Summary collapse
-
#acme_error_body ⇒ Object
readonly
Returns the value of attribute acme_error_body.
-
#problem ⇒ Object
readonly
Returns the value of attribute problem.
-
#retry_after ⇒ Object
readonly
Returns the value of attribute retry_after.
-
#retry_after_time ⇒ Object
readonly
Returns the value of attribute retry_after_time.
-
#subproblems ⇒ Object
readonly
Returns the value of attribute subproblems.
Instance Method Summary collapse
- #code ⇒ Object
- #detail ⇒ Object
- #identifier ⇒ Object
-
#initialize(message = nil, retry_after: nil, acme_error_body: nil, subproblems: nil, problem: nil) ⇒ Error
constructor
A new instance of Error.
- #status ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(message = nil, retry_after: nil, acme_error_body: nil, subproblems: nil, problem: nil) ⇒ Error
Returns a new instance of Error.
12 13 14 15 16 17 18 19 |
# File 'lib/acme/client/error.rb', line 12 def initialize( = nil, retry_after: nil, acme_error_body: nil, subproblems: nil, problem: nil) super() @retry_after_time = Acme::Client::Util.parse_retry_after(retry_after) @retry_after = @retry_after_time ? [(@retry_after_time - Time.now).ceil, 0].max : nil @problem = Acme::Client::Problem.from(problem || acme_error_body) @acme_error_body = acme_error_body || @problem&.to_h @subproblems = parse_subproblems(subproblems || @problem&.raw_subproblems) end |
Instance Attribute Details
#acme_error_body ⇒ Object (readonly)
Returns the value of attribute acme_error_body.
4 5 6 |
# File 'lib/acme/client/error.rb', line 4 def acme_error_body @acme_error_body end |
#problem ⇒ Object (readonly)
Returns the value of attribute problem.
4 5 6 |
# File 'lib/acme/client/error.rb', line 4 def problem @problem end |
#retry_after ⇒ Object (readonly)
Returns the value of attribute retry_after.
4 5 6 |
# File 'lib/acme/client/error.rb', line 4 def retry_after @retry_after end |
#retry_after_time ⇒ Object (readonly)
Returns the value of attribute retry_after_time.
4 5 6 |
# File 'lib/acme/client/error.rb', line 4 def retry_after_time @retry_after_time end |
#subproblems ⇒ Object (readonly)
Returns the value of attribute subproblems.
4 5 6 |
# File 'lib/acme/client/error.rb', line 4 def subproblems @subproblems end |
Instance Method Details
#code ⇒ Object
41 42 43 |
# File 'lib/acme/client/error.rb', line 41 def code problem&.code end |
#detail ⇒ Object
45 46 47 |
# File 'lib/acme/client/error.rb', line 45 def detail problem&.detail || end |
#identifier ⇒ Object
53 54 55 |
# File 'lib/acme/client/error.rb', line 53 def identifier problem&.identifier end |
#status ⇒ Object
49 50 51 |
# File 'lib/acme/client/error.rb', line 49 def status problem&.status end |
#type ⇒ Object
37 38 39 |
# File 'lib/acme/client/error.rb', line 37 def type problem&.type end |