Exception: TezosClient::ScriptRuntimeError
- Inherits:
-
OperationFailure
- Object
- Exception
- 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.
81 82 83 84 85 86 87 88 89 90 |
# File 'lib/tezos_client/exceptions.rb', line 81 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] = "Script runtime Error when executing #{contract}: #{with} (location: #{location})" super end |
Instance Attribute Details
#contract ⇒ Object (readonly)
Returns the value of attribute contract.
79 80 81 |
# File 'lib/tezos_client/exceptions.rb', line 79 def contract @contract end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
77 78 79 |
# File 'lib/tezos_client/exceptions.rb', line 77 def location @location end |
#with ⇒ Object (readonly)
Returns the value of attribute with.
78 79 80 |
# File 'lib/tezos_client/exceptions.rb', line 78 def with @with end |