Module: DnsMock::Error

Defined in:
lib/dns_mock/core.rb,
lib/dns_mock/error/helper.rb,
lib/dns_mock/error/port_in_use.rb,
lib/dns_mock/error/record_type.rb,
lib/dns_mock/error/argument_type.rb,
lib/dns_mock/error/record_context.rb,
lib/dns_mock/error/random_free_port.rb,
lib/dns_mock/error/record_host_type.rb,
lib/dns_mock/error/record_not_found.rb,
lib/dns_mock/error/record_context_type.rb

Defined Under Namespace

Modules: Helper

Constant Summary collapse

PortInUse =
::Class.new(::RuntimeError) do
  def initialize(hostname, port)
    super("Impossible to bind UDP DNS mock server on #{hostname}:#{port}. Address already in use")
  end
end
RecordType =
::Class.new(::StandardError) do
  def initialize(record_type)
    super("#{record_type} is invalid record type")
  end
end
ArgumentType =
::Class.new(::ArgumentError) do
  def initialize(argument_class)
    super("Argument class is a #{argument_class}. Should be a Hash")
  end
end
RecordContext =
::Class.new(::StandardError) do
  def initialize(record_context, record_type)
    super("#{record_context}. Invalid #{record_type} record context")
  end
end
RandomFreePort =
::Class.new(::RuntimeError) do
  def initialize(attempts)
    super("Impossible to find free random port in #{attempts} attempts")
  end
end
RecordHostType =
::Class.new(::ArgumentError) do
  def initialize(hostname, hostname_class)
    super("Hostname #{hostname} type is #{hostname_class}. Should be a String")
  end
end
RecordNotFound =
::Class.new(::StandardError) do
  def initialize(record_type, hostname)
    super("#{record_type.upcase} record not found for #{hostname} in predefined records dictionary")
  end
end
RecordContextType =
::Class.new(::ArgumentError) do
  def initialize(record_context_type, record_type, expected_record_context_type)
    super(
      "#{record_context_type} is invalid record context type for " \
      "#{record_type} record. Should be a " \
      "#{expected_record_context_type}"
    )
  end
end