Exception: Beowulf::BaseError
- Inherits:
-
StandardError
- Object
- StandardError
- Beowulf::BaseError
- Defined in:
- lib/beowulf/base_error.rb
Direct Known Subclasses
ApiError, ExtensionError, OperationError, TransactionError, TypeError, WalletError
Instance Method Summary collapse
-
#initialize(error, cause = nil) ⇒ BaseError
constructor
A new instance of BaseError.
- #to_s ⇒ Object
Constructor Details
#initialize(error, cause = nil) ⇒ BaseError
Returns a new instance of BaseError.
3 4 5 6 |
# File 'lib/beowulf/base_error.rb', line 3 def initialize(error, cause = nil) @error = error @cause = cause end |
Instance Method Details
#to_s ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/beowulf/base_error.rb', line 8 def to_s if !!@cause JSON[error: @error, cause: @cause] rescue {error: @error, cause: @cause}.to_s else JSON[@error] rescue @error end end |