Package com.castlabs.android.player.exceptions

## Class DownloadException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.io.IOException
      - - com.castlabs.android.player.exceptions.DownloadException

- All Implemented Interfaces:
    `Serializable`

      public class DownloadException
      extends IOException

  Exception that is raised when media download errors occur. You can use `getTrackType()` to identify the track that caused the error.
  Since:
    3.0.0
  See Also:
    Serialized Form

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static DownloadException` | `create​(int trackType, Throwable cause)` |
    `static DownloadException` | `create​(Throwable cause)` |
    `String` | `getMessage()` |
    `int` | `getStatusCode()` |
    `int` | `getTrackType()` |
    `Uri` | `getUri()` | The underlying URI that caused the error.

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

- - ### Method Detail

    - #### create

          @NonNull
          public static DownloadException create​(@NonNull
                                                 Throwable cause)

    - #### create

          @NonNull
          public static DownloadException create​(int trackType,
                                                 @NonNull
                                                 Throwable cause)

    - #### getUri

          @Nullable
          public Uri getUri()

      The underlying URI that caused the error. This might be null.
      Returns:
        The URI or null

    - #### getStatusCode

          public int getStatusCode()

      Returns:
        The response status code or -1

    - #### getTrackType

          public int getTrackType()

      Returns:
        The type of the track that caused the error. One of `PlayerController.VIDEO_RENDERER`, `PlayerController.AUDIO_RENDERER`, `PlayerController.TEXT_RENDERER` or `PlayerController.METADATA_RENDERER`

    - #### getMessage

          public String getMessage()

      Overrides:
        `getMessage` in class `Throwable`