Exception: Radiator::BaseError
- Inherits:
-
StandardError
- Object
- StandardError
- Radiator::BaseError
- Defined in:
- lib/radiator/base_error.rb
Direct Known Subclasses
ApiError, ChainError, OperationError, StreamError, TransactionError, TypeError
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/radiator/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/radiator/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 |