# Class AsyncMedia.MediaException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.codename1.media.AsyncMedia.MediaException

Enclosing interface:
  `AsyncMedia`

public static class AsyncMedia.MediaException extends RuntimeException
Encapsulates a media exception.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MediaException(AsyncMedia.MediaErrorType type)`
  Creates an exception of the given type.
  `MediaException(AsyncMedia.MediaErrorType type, String message)`
  Creates an exception of the given type.
  `MediaException(AsyncMedia.MediaErrorType type, Throwable cause)`
  Creates an exception of the given type.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `AsyncMedia.MediaErrorType`
  `getMediaErrorType()`
  Gets the error type.

  ### 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

  - ### MediaException

    public MediaException(AsyncMedia.MediaErrorType type)

    Creates an exception of the given type.

    ###### Parameters

    - `type`: The type of exception

  - ### MediaException

    public MediaException(AsyncMedia.MediaErrorType type, String message)

    Creates an exception of the given type.

    ###### Parameters

    - `type`: THe type of error.

    - `message`: The error message.

  - ### MediaException

    public MediaException(AsyncMedia.MediaErrorType type, Throwable cause)

    Creates an exception of the given type.

    ###### Parameters

    - `type`: The type of error

    - `cause`: An underlying exception that caused this error.

- ## Method Details

  - ### getMediaErrorType

    public AsyncMedia.MediaErrorType getMediaErrorType()
    Gets the error type.