Exception: TezosClient::OperationFailure

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

Direct Known Subclasses

ScriptRuntimeError, TezBalanceTooLow

Constant Summary

Constants included from Logger

Logger::FILTERED_KEYS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logger

#log, #tezos_contents_log, #tezos_contents_log_filter

Constructor Details

#initialize(metadata:, errors:, status:) ⇒ OperationFailure

Returns a new instance of OperationFailure.



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/tezos_client/exceptions.rb', line 59

def initialize(metadata:, errors:, status:)
  @metadata = 
  @errors = errors
  @status = status

  error = errors[0]

  if @message.nil?
    @message = "failure #{status}: #{tezos_contents_log(error).pretty_inspect}"
  end

  super(message)
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



55
56
57
# File 'lib/tezos_client/exceptions.rb', line 55

def errors
  @errors
end

#messageObject (readonly)

Returns the value of attribute message.



57
58
59
# File 'lib/tezos_client/exceptions.rb', line 57

def message
  @message
end

#metadataObject (readonly)

Returns the value of attribute metadata.



54
55
56
# File 'lib/tezos_client/exceptions.rb', line 54

def 
  @metadata
end

#statusObject (readonly)

Returns the value of attribute status.



56
57
58
# File 'lib/tezos_client/exceptions.rb', line 56

def status
  @status
end