Package com.google.android.exoplayer2

## Class ParserException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.io.IOException
      - - com.google.android.exoplayer2.ParserException

- All Implemented Interfaces:
    `Serializable`
  Direct Known Subclasses:
    `SsManifestParser.MissingFieldException`, `UnrecognizedInputFormatException`

      public class ParserException
      extends IOException

  Thrown when an error occurs parsing media data and metadata.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `boolean` | `contentIsMalformed` | Whether the parsing error was caused by a bitstream not following the expected format.
    `int` | `dataType` | The `data type` of the parsed bitstream.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `ParserException​(String message, Throwable cause, boolean contentIsMalformed, @com.google.android.exoplayer2.C.DataType int dataType)` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static ParserException` | `createForMalformedContainer​(String message, Throwable cause)` | Creates a new instance for which `contentIsMalformed` is true and `dataType` is `C.DATA_TYPE_MEDIA`.
    `static ParserException` | `createForMalformedDataOfUnknownType​(String message, Throwable cause)` | Creates a new instance for which `contentIsMalformed` is true and `dataType` is `C.DATA_TYPE_UNKNOWN`.
    `static ParserException` | `createForMalformedManifest​(String message, Throwable cause)` | Creates a new instance for which `contentIsMalformed` is true and `dataType` is `C.DATA_TYPE_MANIFEST`.
    `static ParserException` | `createForManifestWithUnsupportedFeature​(String message, Throwable cause)` | Creates a new instance for which `contentIsMalformed` is false and `dataType` is `C.DATA_TYPE_MANIFEST`.
    `static ParserException` | `createForUnsupportedContainerFeature​(String message)` | Creates a new instance for which `contentIsMalformed` is false and `dataType` is `C.DATA_TYPE_MEDIA`.

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

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

- - ### Field Detail

    - #### contentIsMalformed

          public final boolean contentIsMalformed

      Whether the parsing error was caused by a bitstream not following the expected format. May be false when a parser encounters a legal condition which it does not support.

    - #### dataType

          public final int dataType

      The `data type` of the parsed bitstream.

  - ### Constructor Detail

    - #### ParserException

          protected ParserException​(@Nullable
                                    String message,
                                    @Nullable
                                    Throwable cause,
                                    boolean contentIsMalformed,
                                    @com.google.android.exoplayer2.C.DataType int dataType)

  - ### Method Detail

    - #### createForMalformedDataOfUnknownType

          public static ParserException createForMalformedDataOfUnknownType​(@Nullable
                                                                            String message,
                                                                            @Nullable
                                                                            Throwable cause)

      Creates a new instance for which `contentIsMalformed` is true and `dataType` is `C.DATA_TYPE_UNKNOWN`.
      Parameters:
        `message` - See `Throwable.getMessage()`.
        `cause` - See `Throwable.getCause()`.
      Returns:
        The created instance.

    - #### createForMalformedContainer

          public static ParserException createForMalformedContainer​(@Nullable
                                                                    String message,
                                                                    @Nullable
                                                                    Throwable cause)

      Creates a new instance for which `contentIsMalformed` is true and `dataType` is `C.DATA_TYPE_MEDIA`.
      Parameters:
        `message` - See `Throwable.getMessage()`.
        `cause` - See `Throwable.getCause()`.
      Returns:
        The created instance.

    - #### createForMalformedManifest

          public static ParserException createForMalformedManifest​(@Nullable
                                                                   String message,
                                                                   @Nullable
                                                                   Throwable cause)

      Creates a new instance for which `contentIsMalformed` is true and `dataType` is `C.DATA_TYPE_MANIFEST`.
      Parameters:
        `message` - See `Throwable.getMessage()`.
        `cause` - See `Throwable.getCause()`.
      Returns:
        The created instance.

    - #### createForManifestWithUnsupportedFeature

          public static ParserException createForManifestWithUnsupportedFeature​(@Nullable
                                                                                String message,
                                                                                @Nullable
                                                                                Throwable cause)

      Creates a new instance for which `contentIsMalformed` is false and `dataType` is `C.DATA_TYPE_MANIFEST`.
      Parameters:
        `message` - See `Throwable.getMessage()`.
        `cause` - See `Throwable.getCause()`.
      Returns:
        The created instance.

    - #### createForUnsupportedContainerFeature

          public static ParserException createForUnsupportedContainerFeature​(@Nullable
                                                                             String message)

      Creates a new instance for which `contentIsMalformed` is false and `dataType` is `C.DATA_TYPE_MEDIA`.
      Parameters:
        `message` - See `Throwable.getMessage()`.
      Returns:
        The created instance.