Exception: TezosClient::RpcRequestFailure

Inherits:
StandardError
  • Object
show all
Defined in:
lib/tezos_client/exceptions.rb

Direct Known Subclasses

InvalidActivation, PreviouslyRevealedKey

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error:, url:, status_code:) ⇒ RpcRequestFailure

Returns a new instance of RpcRequestFailure.



8
9
10
11
12
13
14
15
16
17
# File 'lib/tezos_client/exceptions.rb', line 8

def initialize(error:, url:, status_code:)
  @status_code = status_code
  @error = error

  if @message.nil?
    @message = "#{url} failed with status #{status_code}:\n #{error}"
  end

  super @message
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



6
7
8
# File 'lib/tezos_client/exceptions.rb', line 6

def error
  @error
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



5
6
7
# File 'lib/tezos_client/exceptions.rb', line 5

def status_code
  @status_code
end