Class BindPortException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.nilhcem.fakesmtp.core.exception.BindPortException
All Implemented Interfaces:
Serializable

public final class BindPortException extends Exception
Thrown if the SMTP port cannot be bound while trying to start the server.

A port cannot be bound...

  • If it is already use by another application;
  • If the user is not allowed to open it.
    For example on Unix-like machines, we need to be root to open a port < 1024.
Since:
1.0
Author:
Nilhcem
See Also:
  • Constructor Details

    • BindPortException

      public BindPortException(Exception e, int port)
  • Method Details

    • getPort

      public int getPort()
      Returns the port entered by the user.

      Useful to know why the SMTP server could not start.

      Returns:
      the port which caused the exception.