Exception: SolanaRpcRuby::ApiError
- Inherits:
-
StandardError
- Object
- StandardError
- SolanaRpcRuby::ApiError
- Defined in:
- lib/solana_rpc_ruby/api_error.rb
Overview
ApiError is a wrapper class for errors
Instance Attribute Summary collapse
-
#code ⇒ Integer
readonly
Error code.
-
#message ⇒ String
readonly
Error message.
Instance Method Summary collapse
-
#initialize(message:, error_class: nil, code: nil) ⇒ SolanaRpcRuby::ApiError
constructor
Initialize object with json response from the API with error.
Constructor Details
#initialize(message:, error_class: nil, code: nil) ⇒ SolanaRpcRuby::ApiError
Initialize object with json response from the API with error.
20 21 22 23 24 25 26 27 28 |
# File 'lib/solana_rpc_ruby/api_error.rb', line 20 def initialize(message:, error_class: nil, code: nil) @code = code @message = .to_s @error_class = error_class additional_info super @message end |
Instance Attribute Details
#code ⇒ Integer (readonly)
Error code.
8 9 10 |
# File 'lib/solana_rpc_ruby/api_error.rb', line 8 def code @code end |
#message ⇒ String (readonly)
Error message.
12 13 14 |
# File 'lib/solana_rpc_ruby/api_error.rb', line 12 def @message end |