Exception: Solace::ZarTrustlessEscrow::Errors::ProgramError

Inherits:
Solace::ZarTrustlessEscrow::Error show all
Defined in:
lib/solace/zar_trustless_escrow/errors/program_error.rb

Overview

A resolved on-chain TrustlessEscrowError, carrying its custom error code, variant name, and message. Returned by #from_code and #from_name so callers can translate a failed transaction’s custom error code into a meaningful, rescuable Ruby error.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code:, error_name:, message:) ⇒ ProgramError

Returns a new instance of ProgramError.

Parameters:

  • code (Integer)

    The on-chain custom error code.

  • error_name (String)

    The TrustlessEscrowError variant name.

  • message (String)

    The variant’s on-chain #[msg] text.



22
23
24
25
26
# File 'lib/solace/zar_trustless_escrow/errors/program_error.rb', line 22

def initialize(code:, error_name:, message:)
  @code = code
  @error_name = error_name
  super(message)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



13
14
15
# File 'lib/solace/zar_trustless_escrow/errors/program_error.rb', line 13

def code
  @code
end

#error_nameObject (readonly)

Returns the value of attribute error_name.



17
18
19
# File 'lib/solace/zar_trustless_escrow/errors/program_error.rb', line 17

def error_name
  @error_name
end