public final class ExoPlaybackException extends Exception
Modifier and Type | Class and Description |
---|---|
static interface |
ExoPlaybackException.Type
The type of source that produced the error.
|
Modifier and Type | Field and Description |
---|---|
int |
rendererIndex
If
type is TYPE_RENDERER , this is the index of the renderer. |
int |
type
The type of the playback failure.
|
static int |
TYPE_RENDERER
The error occurred in a
Renderer . |
static int |
TYPE_SOURCE
The error occurred loading data from a
MediaSource . |
static int |
TYPE_UNEXPECTED
The error was an unexpected
RuntimeException . |
Modifier and Type | Method and Description |
---|---|
static ExoPlaybackException |
createForRenderer(Exception cause,
int rendererIndex)
Creates an instance of type
TYPE_RENDERER . |
static ExoPlaybackException |
createForSource(IOException cause)
Creates an instance of type
TYPE_SOURCE . |
Exception |
getRendererException()
Retrieves the underlying error when
type is TYPE_RENDERER . |
IOException |
getSourceException()
Retrieves the underlying error when
type is TYPE_SOURCE . |
RuntimeException |
getUnexpectedException()
Retrieves the underlying error when
type is TYPE_UNEXPECTED . |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public static final int TYPE_SOURCE
MediaSource
.
Call getSourceException()
to retrieve the underlying cause.
public static final int TYPE_RENDERER
Renderer
.
Call getRendererException()
to retrieve the underlying cause.
public static final int TYPE_UNEXPECTED
RuntimeException
.
Call getUnexpectedException()
to retrieve the underlying cause.
public final int type
public final int rendererIndex
type
is TYPE_RENDERER
, this is the index of the renderer.public static ExoPlaybackException createForRenderer(Exception cause, int rendererIndex)
TYPE_RENDERER
.cause
- The cause of the failure.rendererIndex
- The index of the renderer in which the failure occurred.public static ExoPlaybackException createForSource(IOException cause)
TYPE_SOURCE
.cause
- The cause of the failure.public IOException getSourceException()
type
is TYPE_SOURCE
.IllegalStateException
- If type
is not TYPE_SOURCE
.public Exception getRendererException()
type
is TYPE_RENDERER
.IllegalStateException
- If type
is not TYPE_RENDERER
.public RuntimeException getUnexpectedException()
type
is TYPE_UNEXPECTED
.IllegalStateException
- If type
is not TYPE_UNEXPECTED
.