Exception: Solace::Errors::ParseError
- Defined in:
- lib/solace/errors/parse_error.rb
Overview
Raised when parsing or deserializing data fails.
This error is raised when the gem encounters data that cannot be properly parsed or deserialized, such as malformed JSON responses from the RPC node, invalid binary data, or unexpected data structures. This typically indicates either a bug in the gem or an incompatibility with the RPC node’s response format.
Instance Attribute Summary collapse
- #body ⇒ Object readonly
Class Method Summary collapse
-
.format_response(error, response) ⇒ Solace::Errors::ParseError
Formats a response to an error.
Instance Method Summary collapse
-
#initialize(message, body:) ⇒ ParseError
constructor
A new instance of ParseError.
Constructor Details
#initialize(message, body:) ⇒ ParseError
Returns a new instance of ParseError.
25 26 27 28 |
# File 'lib/solace/errors/parse_error.rb', line 25 def initialize(, body:) super() @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
21 22 23 |
# File 'lib/solace/errors/parse_error.rb', line 21 def body @body end |
Class Method Details
.format_response(error, response) ⇒ Solace::Errors::ParseError
Formats a response to an error
35 36 37 |
# File 'lib/solace/errors/parse_error.rb', line 35 def self.format_response(error, response) new("Invalid JSON from RPC: #{error.}", body: response.body) end |