com.jscape.inspect

## Class InvalidEmailException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - com.jscape.inspect.InvalidEmailException

- All Implemented Interfaces:
    java.io.Serializable

      public class InvalidEmailException
      extends java.lang.Exception

  InvalidEmailException is thrown when an email address is found to be invalid. At times, network related issues such as the inability to connect to a DNS or SMTP server during validation will cause an InvalidEmailException to be thrown.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DENIED_DOMAIN_ERROR` Indicates email address contains a denied domain as defined in EmailInspector instance.
    `static int` | `INVALID_DOMAIN_ERROR` Indicates email address contains an invalid domain name.
    `static int` | `INVALID_MX_ERROR` Indicates error locating SMTP server for email address.
    `static int` | `INVALID_SYNTAX_ERROR` Indicates syntax error in email address.
    `static int` | `INVALID_USER_ERROR` Indicates invalid user portion of email address.
    `static int` | `IO_ERROR` Indicates I/O error communicating with DNS Nameserver or SMTP server.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InvalidEmailException(java.lang.String email, int errorCode)` Exception thrown to handle an invalid email.
    `InvalidEmailException(java.lang.String message, java.lang.String email)` Creates exception with specified message string.
    `InvalidEmailException(java.lang.String message, java.lang.String email, java.lang.Throwable cause)` Creates exception with specified message String, email and base exception.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getEmail()` Gets the EmailAddress associated with this exception.
    `int` | `getErrorCode()` Gets error code associated with error.
    `java.lang.String` | `getMessage()` Gets error message for this exception.

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### IO_ERROR

          public static final int IO_ERROR

      Indicates I/O error communicating with DNS Nameserver or SMTP server.
      See Also:
        Constant Field Values

    - #### INVALID_SYNTAX_ERROR

          public static final int INVALID_SYNTAX_ERROR

      Indicates syntax error in email address.
      See Also:
        Constant Field Values

    - #### DENIED_DOMAIN_ERROR

          public static final int DENIED_DOMAIN_ERROR

      Indicates email address contains a denied domain as defined in EmailInspector instance.
      See Also:
        Constant Field Values

    - #### INVALID_DOMAIN_ERROR

          public static final int INVALID_DOMAIN_ERROR

      Indicates email address contains an invalid domain name.
      See Also:
        Constant Field Values

    - #### INVALID_MX_ERROR

          public static final int INVALID_MX_ERROR

      Indicates error locating SMTP server for email address.
      See Also:
        Constant Field Values

    - #### INVALID_USER_ERROR

          public static final int INVALID_USER_ERROR

      Indicates invalid user portion of email address.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### InvalidEmailException

          public InvalidEmailException(java.lang.String message,
                                       java.lang.String email)

      Creates exception with specified message string.
      Parameters:
        `message` - the error message
        `email` - the email address

    - #### InvalidEmailException

          public InvalidEmailException(java.lang.String message,
                                       java.lang.String email,
                                       java.lang.Throwable cause)

      Creates exception with specified message String, email and base exception.
      Parameters:
        `message` - the error message
        `email` - the email address
        `cause` - the exception which generated this exception

    - #### InvalidEmailException

          public InvalidEmailException(java.lang.String email,
                                       int errorCode)

      Exception thrown to handle an invalid email.
      Parameters:
        `email` - the email
        `errorCode` - the type of error encountered

  - ### Method Detail

    - #### getEmail

          public java.lang.String getEmail()

      Gets the EmailAddress associated with this exception.
      Returns:
        the email address

    - #### getErrorCode

          public int getErrorCode()

      Gets error code associated with error.
      Returns:
        error code
      See Also:
        `IO_ERROR`, `INVALID_SYNTAX_ERROR`, `INVALID_DOMAIN_ERROR`, `DENIED_DOMAIN_ERROR`, `INVALID_MX_ERROR`, `INVALID_USER_ERROR`

    - #### getMessage

          public java.lang.String getMessage()

      Gets error message for this exception.
      Overrides:
        `getMessage` in class `java.lang.Throwable`
      Returns:
        error message

Copyright © JSCAPE LLC. 1999-2021. All Rights Reserved