# Action.ThrowPlaybackException

Artifact: [androidx.media3:media3-test-utils](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/test/utils/Action.java+class:androidx.media3.test.utils.Action.ThrowPlaybackException)

*** ** * ** ***


```
public final class Action.ThrowPlaybackException extends Action
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.media3.test.utils.Action](https://developer.android.com/reference/androidx/media3/test/utils/Action) ||
|   | ↳ | [androidx.media3.test.utils.Action.ThrowPlaybackException](https://developer.android.com/reference/androidx/media3/test/utils/Action.ThrowPlaybackException) |

*** ** * ** ***

Throws a playback exception on the playback thread.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/Action.ThrowPlaybackException#ThrowPlaybackException(java.lang.String,androidx.media3.exoplayer.ExoPlaybackException)( @https://developer.android.com/reference/androidx/annotation/Size(max = 23) https://developer.android.com/reference/java/lang/String.html tag, https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlaybackException exception )` |

| ### Protected methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/Action.ThrowPlaybackException#doActionImpl(androidx.media3.exoplayer.ExoPlayer,androidx.media3.exoplayer.trackselection.DefaultTrackSelector,android.view.Surface)( https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlayer player, https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/DefaultTrackSelector trackSelector, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/view/Surface.html surface )` Called by `https://developer.android.com/reference/androidx/media3/test/utils/Action#doActionAndScheduleNextImpl(androidx.media3.exoplayer.ExoPlayer,androidx.media3.exoplayer.trackselection.DefaultTrackSelector,android.view.Surface,androidx.media3.common.util.HandlerWrapper,androidx.media3.test.utils.ActionSchedule.ActionNode)` to perform the action. |

## Public constructors

### ThrowPlaybackException

```
public ThrowPlaybackException(
    @Size(max = 23) String tag,
    ExoPlaybackException exception
)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Size(max = 23) https://developer.android.com/reference/java/lang/String.html tag` | A tag to use for logging. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlaybackException exception` | The exception to throw. |

## Protected methods

### doActionImpl

```
protected void doActionImpl(
    ExoPlayer player,
    DefaultTrackSelector trackSelector,
    @Nullable Surface surface
)
```

Called by `https://developer.android.com/reference/androidx/media3/test/utils/Action#doActionAndScheduleNextImpl(androidx.media3.exoplayer.ExoPlayer,androidx.media3.exoplayer.trackselection.DefaultTrackSelector,android.view.Surface,androidx.media3.common.util.HandlerWrapper,androidx.media3.test.utils.ActionSchedule.ActionNode)` to perform the action.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlayer player` | The player to which the action should be applied. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/DefaultTrackSelector trackSelector` | The track selector to which the action should be applied. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/view/Surface.html surface` | The surface to use when applying actions, or `null` if no surface is needed. |