Exception: OpenReceive::Server::WalletFailureError
- Inherits:
-
StandardError
- Object
- StandardError
- OpenReceive::Server::WalletFailureError
- Defined in:
- lib/openreceive/server/errors.rb
Overview
Wallet/relay failure normalized per the shared error-normalization vectors. Carries the canonical code and retryable flag so browsers can distinguish "retry" from "bug" against Rails exactly as against Node.
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#retryable ⇒ Object
readonly
Returns the value of attribute retryable.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(normalized) ⇒ WalletFailureError
constructor
A new instance of WalletFailureError.
Constructor Details
#initialize(normalized) ⇒ WalletFailureError
Returns a new instance of WalletFailureError.
171 172 173 174 175 176 177 |
# File 'lib/openreceive/server/errors.rb', line 171 def initialize(normalized) super(normalized.fetch("message")) @code = normalized.fetch("code") @retryable = normalized.fetch("retryable", false) @details = normalized["details"] @status = @retryable ? 503 : 502 end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
169 170 171 |
# File 'lib/openreceive/server/errors.rb', line 169 def code @code end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
169 170 171 |
# File 'lib/openreceive/server/errors.rb', line 169 def details @details end |
#retryable ⇒ Object (readonly)
Returns the value of attribute retryable.
169 170 171 |
# File 'lib/openreceive/server/errors.rb', line 169 def retryable @retryable end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
169 170 171 |
# File 'lib/openreceive/server/errors.rb', line 169 def status @status end |