Exception: BSV::Wallet::InvalidParameterError

Inherits:
Error
  • Object
show all
Defined in:
lib/bsv/wallet/errors.rb

Overview

Code 6 — a required parameter is missing or invalid.

Two calling conventions:

InvalidParameterError.new('pubkey', 'a hex string')  # raises "the pubkey parameter must be ..."
InvalidParameterError.new('raw message')              # wire-rehydration path

Instance Attribute Summary collapse

Attributes inherited from Error

#code, #wallet_stack

Instance Method Summary collapse

Methods inherited from Error

#to_wire

Constructor Details

#initialize(parameter, must_be = nil, stack: '') ⇒ InvalidParameterError

Returns a new instance of InvalidParameterError.



59
60
61
62
63
# File 'lib/bsv/wallet/errors.rb', line 59

def initialize(parameter, must_be = nil, stack: '')
  @parameter = must_be ? parameter : nil
  message = must_be ? "the #{parameter} parameter must be #{must_be}" : parameter
  super(message, code: 6, stack: stack)
end

Instance Attribute Details

#parameterObject (readonly)

Returns the value of attribute parameter.



57
58
59
# File 'lib/bsv/wallet/errors.rb', line 57

def parameter
  @parameter
end