Class DnsStartupException

All Implemented Interfaces:
Serializable

public class DnsStartupException extends RuntimeException
Thrown at start-up when dnsEnabled is true and the DNS server could not be started on dnsPort, so that MockServer does not run without a listener it was configured to serve. The message is one line naming the port and the root cause. It is not an IllegalArgumentException, whatever its cause: the CLI treats that as a usage error and exits 0.
See Also:
  • Method Details

    • portCouldNotBeOpenedOrBound

      public static DnsStartupException portCouldNotBeOpenedOrBound(int dnsPort, Throwable cause)
      The channel for an explicit dnsPort could not be created, registered or bound; a bind the operating system refused is the usual case. That is told by where the start failed, not by the type of cause: for a refused bind the NIO transport reports a BindException, the epoll transport an IOException of its own.
    • serverCouldNotStart

      public static DnsStartupException serverCouldNotStart(int dnsPort, Throwable cause)
    • isPortUnavailable

      public boolean isPortUnavailable()
      Returns:
      true if an explicit UDP port could not be opened or bound, which the message alone explains