Fork me on GitHub

Error Reference

As described in the introduction to Errors & Exceptions, error classes can be grouped into categories, according to their scope. We can identify 4 categories:

  1. Base Errors: contains the base error class Whois::Error.
  2. Server Errors: contains errors raised by the server component. It mostly includes definition errors.
  3. Interface Errors: contains errors raised in case of a WHOIS interface for a domain is missing or invalid.
  4. Parser Errors: contains errors generated by the parser component during the analysis or elaboration of a WHOIS record.
  5. Response Errors: contains errors raised when the server response is not successful.

Here’s the error list, grouped by category.

Category Class
Base Errors Whois::Error
Connection Errors Whois::ConnectionError
Server Errors Whois::ServerError
  Whois::ServerNotFound
  Whois::ServerNotImplemented
  Whois::ServerNotSupported
  Whois::AllocationUnknown
Interface Errors Whois::InterfaceNotSupported
  Whois::NoInterfaceError
  Whois::WebInterfaceError
Parser Errors Whois::ParserError
  Whois::ParserNotFound
  Whois::AttributeNotImplemented
  Whois::AttributeNotSupported
Response Errors Whois::ResponseError
  Whois::ResponseIsThrottled
  Whois::ResponseIsUnavailable

Base Errors

Whois::Error

This is the base exception class for any Whois error. All Whois exceptions inherits from this class. This error is never raised directly.

Connection Errors

Whois::ConnectionError

Raised when the connection to the WHOIS server fails.

r = Whois.whois "google.dm"
# => raise Whois::ConnectionError,
#          "Errno::ECONNREFUSED: Connection refused - connect(2)"

Server Errors

Whois::ServerError

Generic class for server errors. This error is never raised directly.

Whois::ServerNotFound

Raised when the class hasn’t been able to select a valid server probably because definitions are outdated.

Definition is not recognized.

Whois::ServerNotImplemented

Raised when we know about a specific functionality but this functionality has not been implemented yet. This is usually the result of a porting from a third-party library.

Definition is recognized.

Whois::ServerNotSupported

Raised when no WHOIS server is known for this kind of object.

Definition is recognized.

Whois::AllocationUnknown

Raised when unknown AS number of IP network.

Definition is recognized.

Interface Errors

Whois::InterfaceNotSupported

Generic class for interfaces not supported. This error is never raised directly.

Whois::NoInterfaceError

Raised when a server is known to not be available for this kind of object or because this specific object doesn’t support WHOIS.

Whois::WebInterfaceError #{#errors-reference-whois-webinterfaceerror}

Raised when the class has found a server but it doesn’t support the standard WHOIS interface via port 43. This is the case of some specific domains that only provide a web-based WHOIS interface.

Parser Errors

Whois::ParserError

Generic class for parser errors. This error is never raised directly.

Whois::ParserNotFound

Raised when the library hasn’t been able to load a valid parser according to current settings and you’re trying to access a property that requires a valid parser.

r = Whois.whois "example.com"
p = r.parser.parsers.first

# assuming the parser is not supported
# the default parser is used
p.class
# => Whois::Record::Parser::Blank

p.status
# => raise Whois::ParserNotFound

Whois::AttributeNotImplemented

Raised when the property method has not been overwritten (implemented) in a child parser class.

Whois::AttributeNotSupported

Raised when you are trying to access a property that is not supported for the current WHOIS record.

Response Errors

Whois::ResponseError

Generic class for response errors. This error is never raised directly.

Whois::ResponseIsThrottled

Raised when the response contains a throttling message.

r = Whois.whois "example.nl"

puts r.to_s
# => "whois.domain-registry.nl: daily whois-limit exceeded"

p.status
# => raise Whois::ResponseIsThrottled

Whois::ResponseIsUnavailable

Raised when the response contains an unavailable message.

r = Whois.whois "example.it"

puts r.to_s
# => "Service temporarily unavailable.\n"

p.status
# => raise Whois::ResponseIsUnavailable