# Class VpnException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.codename1.vpn.VpnException

public class VpnException extends Exception
Thrown through the failure path of every `AsyncResource` returned by the `com.codename1.vpn` APIs. `getError()` returns a typed `VpnError` so callers react without string-matching the message.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VpnException(VpnError error)`
  `VpnException(VpnError error, String message)`
  `VpnException(VpnError error, String message, Throwable cause)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `VpnError`
  `getError()`
  Typed error code describing the failure.

  ### Methods inherited from class Throwable

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

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### VpnException

    public VpnException(VpnError error)

  - ### VpnException

    public VpnException(VpnError error, String message)

  - ### VpnException

    public VpnException(VpnError error, String message, Throwable cause)

- ## Method Details

  - ### getError

    public VpnError getError()
    Typed error code describing the failure. Never `null`.