Exception: Confium::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Confium::Error
- Defined in:
- lib/confium/errors.rb
Direct Known Subclasses
CryptoError, IndexError, NotFoundError, ParseError, PolicyViolationError, SecureBytes::ClearedError, ThresholdError, UnresolvedSignerError, ValidationError, VerificationError
Instance Attribute Summary collapse
-
#details ⇒ Object
readonly
Returns the value of attribute details.
Instance Method Summary collapse
-
#initialize(message = nil, details_hash = nil, details: {}) ⇒ Error
constructor
The native extension constructs errors positionally (message, details_hash) — the same shape every typed subclass accepts via Errors::Coerce.
- #to_h ⇒ Object
Constructor Details
#initialize(message = nil, details_hash = nil, details: {}) ⇒ Error
The native extension constructs errors positionally (message, details_hash) — the same shape every typed subclass accepts via Errors::Coerce. Accepting it here keeps the whole family uniform; the keyword form still works.
19 20 21 22 23 24 25 26 27 |
# File 'lib/confium/errors.rb', line 19 def initialize( = nil, details_hash = nil, details: {}) base = if details_hash.is_a?(Hash) && !details_hash.empty? details_hash else details end @details = base.transform_keys(&:to_sym) super() end |
Instance Attribute Details
#details ⇒ Object (readonly)
Returns the value of attribute details.
13 14 15 |
# File 'lib/confium/errors.rb', line 13 def details @details end |
Instance Method Details
#to_h ⇒ Object
29 30 31 |
# File 'lib/confium/errors.rb', line 29 def to_h { class: self.class.name, message: , details: details } end |