class TezosClient::ScriptRuntimeError

Constants

ERROR_REGEXP
FIRST_ERROR_REGEXP

Attributes

contract[R]
location[R]
with[R]

Public Class Methods

new(metadata:, errors:, status:) click to toggle source
Calls superclass method TezosClient::OperationFailure::new
# 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