# Enum VpnError

java.lang.Object
java.lang.Enum<VpnError>
com.codename1.vpn.VpnError

All Implemented Interfaces:
  `Comparable<VpnError>`

public enum VpnError extends Enum<VpnError>
Typed error codes carried by `VpnException`. Branch on these rather than on the message.

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `AUTHENTICATION_FAILED`
  The credentials were refused by the server.
  `CONNECTION_FAILED`
  The tunnel could not be established -- unreachable server, no network, or a negotiation failure.
  `INVALID_CONFIGURATION`
  The configuration was rejected: a malformed server address, an authentication method the platform does not offer, or a certificate it could not read.
  `NOT_CONFIGURED`
  No configuration is installed, so there was nothing to act on.
  `NOT_SUPPORTED`
  VPN management is not available on this port or this OS version.
  `TIMEOUT`
  The platform never answered within the safety timeout.
  `UNAUTHORIZED`
  The app is missing the entitlement or permission the platform requires.
  `UNKNOWN`
  Nothing more specific is known.
  `USER_DECLINED`
  The user declined the system prompt that has to precede installing a configuration.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static VpnError`
  `valueOf(String name)`
  Returns the enum constant of this type with the specified name.
  `static VpnError[]`
  `values()`
  Returns an array containing the constants of this enum type, in the order they are declared.

  ### Methods inherited from class Enum

  `clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf`

  ### Methods inherited from class Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### NOT_SUPPORTED

    public static final VpnError NOT_SUPPORTED
    VPN management is not available on this port or this OS version. Android needs API 30 for the managed profile API; the desktop and browser ports have no equivalent at all.

  - ### USER_DECLINED

    public static final VpnError USER_DECLINED
    The user declined the system prompt that has to precede installing a configuration. Both platforms show one, and neither lets an app install a VPN without it.

  - ### INVALID_CONFIGURATION

    public static final VpnError INVALID_CONFIGURATION
    The configuration was rejected: a malformed server address, an authentication method the platform does not offer, or a certificate it could not read.

  - ### AUTHENTICATION_FAILED

    public static final VpnError AUTHENTICATION_FAILED
    The credentials were refused by the server.

  - ### CONNECTION_FAILED

    public static final VpnError CONNECTION_FAILED
    The tunnel could not be established -- unreachable server, no network, or a negotiation failure.

  - ### UNAUTHORIZED

    public static final VpnError UNAUTHORIZED
    The app is missing the entitlement or permission the platform requires. On iOS this usually means the Personal VPN capability is not enabled on the App ID.

  - ### NOT_CONFIGURED

    public static final VpnError NOT_CONFIGURED
    No configuration is installed, so there was nothing to act on.

  - ### TIMEOUT

    public static final VpnError TIMEOUT
    The platform never answered within the safety timeout.

  - ### UNKNOWN

    public static final VpnError UNKNOWN
    Nothing more specific is known.

- ## Method Details

  - ### values

    public static VpnError[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.
    Returns:
      an array containing the constants of this enum type, in the order they are declared

  - ### valueOf

    public static VpnError valueOf(String name)
    Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
    Parameters:
      `name` - the name of the enum constant to be returned.
    Returns:
      the enum constant with the specified name
    Throws:
      `IllegalArgumentException` - if this enum type has no constant with the specified name
      `NullPointerException` - if the argument is null