Exception: NwcRuby::WalletServiceError

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

Overview

The wallet service returned an error envelope. ‘#code` is the NIP-47 error code (one of RATE_LIMITED, NOT_IMPLEMENTED, INSUFFICIENT_BALANCE, QUOTA_EXCEEDED, RESTRICTED, UNAUTHORIZED, INTERNAL, UNSUPPORTED_ENCRYPTION, PAYMENT_FAILED, NOT_FOUND, or OTHER).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, message) ⇒ WalletServiceError

Returns a new instance of WalletServiceError.



27
28
29
30
# File 'lib/nwc_ruby/errors.rb', line 27

def initialize(code, message)
  @code = code
  super("#{code}: #{message}")
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



25
26
27
# File 'lib/nwc_ruby/errors.rb', line 25

def code
  @code
end