Sha256: 3de797bdd67924666905558fa8bbf2cf3f6c1c3ef9581a97eb0f639917d627ff

Contents?: true

Size: 460 Bytes

Versions: 2

Compression:

Stored size: 460 Bytes

Contents

module IPCrypt
  class InvalidIPv4Error < Exception
    def initialize(ip)
      super "Invalid IPv4 address: #{ip}"
    end
  end
  class InvalidKeyTypeError < Exception
    def initialize(key, type)
      super "Expected key '#{key}' to be a String, got #{type}"
    end
  end
  class InvalidKeyBytesError < Exception
    def initialize(key, bytes)
      super "Expected key '#{key}' to be 16-byte, got #{bytes} byte#{bytes == 1 ? '' : ?s}"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ipcrypt-1.0.1 lib/ipcrypt/exceptions.rb
ipcrypt-1.0.0 lib/ipcrypt/exceptions.rb