Exception: Proxy::OpenBolt::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Proxy::OpenBolt::Error
- Defined in:
- lib/smart_proxy_openbolt/error.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#details ⇒ Object
readonly
Returns the value of attribute details.
Instance Method Summary collapse
-
#initialize(message:, **details) ⇒ Error
constructor
A new instance of Error.
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(message:, **details) ⇒ Error
Returns a new instance of Error.
5 6 7 8 |
# File 'lib/smart_proxy_openbolt/error.rb', line 5 def initialize(message:, **details) @details = details super() end |
Instance Attribute Details
#details ⇒ Object (readonly)
Returns the value of attribute details.
3 4 5 |
# File 'lib/smart_proxy_openbolt/error.rb', line 3 def details @details end |
Instance Method Details
#to_json(*args) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/smart_proxy_openbolt/error.rb', line 10 def to_json(*args) result = { message: } details.each do |key, val| if key == :exception && val.is_a?(Exception) result[:exception] = { class: val.class.to_s, message: val., backtrace: val.backtrace, } else result[key] = val unless val.nil? end end { error: result }.to_json(*args) end |