Exception: TezosClient::ScriptRuntimeError
- Inherits:
-
OperationFailure
- Object
- StandardError
- OperationFailure
- TezosClient::ScriptRuntimeError
- Defined in:
- lib/tezos_client/exceptions.rb
Constant Summary collapse
- FIRST_ERROR_REGEXP =
/proto.\d*-\w*\.(scriptRejectedRuntimeError|michelson_v\d\.runtime_error)/
- ERROR_REGEXP =
/proto.\d*-\w*\.(scriptRejectedRuntimeError|michelson_v\d\.script_rejected)/
Constants included from Logger
Instance Attribute Summary collapse
-
#contract ⇒ Object
readonly
Returns the value of attribute contract.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#with ⇒ Object
readonly
Returns the value of attribute with.
Attributes inherited from OperationFailure
#errors, #message, #metadata, #status
Instance Method Summary collapse
-
#initialize(metadata:, errors:, status:) ⇒ ScriptRuntimeError
constructor
A new instance of ScriptRuntimeError.
Methods included from Logger
#log, #tezos_contents_log, #tezos_contents_log_filter
Constructor Details
#initialize(metadata:, errors:, status:) ⇒ ScriptRuntimeError
Returns a new instance of ScriptRuntimeError.
101 102 103 104 105 106 107 108 109 110 |
# File 'lib/tezos_client/exceptions.rb', line 101 def initialize(metadata:, errors:, status:) first_error = errors[0] rejection_error = errors.detect { |error| error[:id].match? ERROR_REGEXP } @location = rejection_error[:location] @contract = first_error[:contractHandle] @with = rejection_error[:with] @message = "Script runtime Error when executing #{contract}: #{with} (location: #{location})" super end |
Instance Attribute Details
#contract ⇒ Object (readonly)
Returns the value of attribute contract.
99 100 101 |
# File 'lib/tezos_client/exceptions.rb', line 99 def contract @contract end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
97 98 99 |
# File 'lib/tezos_client/exceptions.rb', line 97 def location @location end |
#with ⇒ Object (readonly)
Returns the value of attribute with.
98 99 100 |
# File 'lib/tezos_client/exceptions.rb', line 98 def with @with end |