Sha256: fa580f2fc78302b3a56bb6bce8747d88a1340f28970f0eb37673f007e98614e4
Contents?: true
Size: 520 Bytes
Versions: 8
Compression:
Stored size: 520 Bytes
Contents
module BitWallet class HandlesError def self.from(message) error = if message.include?("-6") InsufficientFunds.new("cannot send an amount more than what this account has") elsif message.include?("-3") InvalidAmount.new("amount is invalid") elsif message.include?("-5") InvalidAddress.new("bitcoin address is invalid") else ArgumentError.new("unknown error: #{message}") end fail error if error end end end
Version data entries
8 entries across 8 versions & 1 rubygems