Package com.castlabs.android.player.exceptions

# Class BlocklistException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.castlabs.android.player.exceptions.BlocklistException

All Implemented Interfaces:
  `Serializable`

public class BlocklistException extends Exception
Exception thrown when a track is blocklisted.

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final long`
  `durationMs`
  The duration of the blocklisted track in milliseconds.
  `final com.google.android.exoplayer2.Format`
  `format`
  The format of the blocklisted track.
  `final int`
  `reason`
  The reason why the track was blocklisted.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static BlocklistException`
  `create(int reason, String message, com.google.android.exoplayer2.Format format, long durationMs)`
  Creates a new BlocklistException.
  `String`
  `reasonString()`
  Returns a string representation of the reason why the track was blocklisted.

  ### Methods inherited from class java.lang.Throwable

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

  ### Methods inherited from class java.lang.Object

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

- ## Field Details

  - ### reason

    public final int reason
    The reason why the track was blocklisted.

  - ### format

    @NonNull public final com.google.android.exoplayer2.Format format
    The format of the blocklisted track.

  - ### durationMs

    public final long durationMs
    The duration of the blocklisted track in milliseconds.

- ## Method Details

  - ### create

    @NonNull public static BlocklistException create(int reason, @NonNull String message, @NonNull com.google.android.exoplayer2.Format format, long durationMs)
    Creates a new BlocklistException.
    Parameters:
      `reason` - The reason why the track was blocklisted.
      `message` - A message describing the reason for the blocklisting.
      `format` - The format of the blocklisted track.
      `durationMs` - The duration of the blocklisted track in milliseconds.
    Returns:
      A new BlocklistException.

  - ### reasonString

    @NonNull public String reasonString()
    Returns a string representation of the reason why the track was blocklisted.
    Returns:
      A string representation of the reason.