# ParserException

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

*** ** * ** ***


```
@UnstableApi
class ParserException : IOException
```

<br />

|---|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html) ||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/java/lang/Exception.html) |||
|   |   | ↳ | [java.io.IOException](https://developer.android.com/reference/java/io/IOException.html) ||
|   |   |   | ↳ | [androidx.media3.common.ParserException](https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException) |

Known direct subclasses [SsManifestParser.MissingFieldException](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifestParser.MissingFieldException), [UnrecognizedInputFormatException](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/UnrecognizedInputFormatException)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifestParser.MissingFieldException` | Thrown if a required field is missing. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/UnrecognizedInputFormatException` | Thrown if the input format was not recognized. |

*** ** * ** ***

Thrown when an error occurs parsing media data and metadata.

## Summary

| ### Protected constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#ParserException(java.lang.String,java.lang.Throwable,boolean,int)( message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?, contentIsMalformed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, @https://developer.android.com/reference/kotlin/androidx/media3/common/C.DataType dataType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` |

| ### Public functions |
|---|---|
| `java-static https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#createForMalformedContainer(java.lang.String,java.lang.Throwable)(message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?)` Creates a new instance for which `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#contentIsMalformed()` is true and `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#dataType()` is `https://developer.android.com/reference/kotlin/androidx/media3/common/C#DATA_TYPE_MEDIA()`. |
| `java-static https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#createForMalformedDataOfUnknownType(java.lang.String,java.lang.Throwable)(message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?)` Creates a new instance for which `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#contentIsMalformed()` is true and `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#dataType()` is `https://developer.android.com/reference/kotlin/androidx/media3/common/C#DATA_TYPE_UNKNOWN()`. |
| `java-static https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#createForMalformedManifest(java.lang.String,java.lang.Throwable)(message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?)` Creates a new instance for which `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#contentIsMalformed()` is true and `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#dataType()` is `https://developer.android.com/reference/kotlin/androidx/media3/common/C#DATA_TYPE_MANIFEST()`. |
| `java-static https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#createForMalformedSteeringManifest(java.lang.String,java.lang.Throwable)(message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?)` Creates a new instance for which `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#contentIsMalformed()` is true and `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#dataType()` is `https://developer.android.com/reference/kotlin/androidx/media3/common/C#DATA_TYPE_STEERING_MANIFEST()`. |
| `java-static https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#createForManifestWithUnsupportedFeature(java.lang.String,java.lang.Throwable)( message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html? )` Creates a new instance for which `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#contentIsMalformed()` is false and `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#dataType()` is `https://developer.android.com/reference/kotlin/androidx/media3/common/C#DATA_TYPE_MANIFEST()`. |
| `java-static https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#createForUnsupportedContainerFeature(java.lang.String)(message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Creates a new instance for which `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#contentIsMalformed()` is false and `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#dataType()` is `https://developer.android.com/reference/kotlin/androidx/media3/common/C#DATA_TYPE_MEDIA()`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#getMessage()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#contentIsMalformed()` Whether the parsing error was caused by a bitstream not following the expected format. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#dataType()` The `https://developer.android.com/reference/kotlin/androidx/media3/common/C.DataType` of the parsed bitstream. |

| ### Inherited functions |
|---|
| From [java.lang.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) |---|---| | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/add-suppressed.html(exception: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!)` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/fill-in-stack-trace.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-cause.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-localized-message.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html!>!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-stack-trace.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!>!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-suppressed.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/init-cause.html(cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/print-stack-trace.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/set-stack-trace.html(stackTrace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html!>!)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/to-string.html()` | |

## Protected constructors

### ParserException

```
protected ParserException(
    message: String?,
    cause: Throwable?,
    contentIsMalformed: Boolean,
    @C.DataType dataType: Int
)
```

## Public functions

### createForMalformedContainer

```
java-static fun createForMalformedContainer(message: String?, cause: Throwable?): ParserException!
```

Creates a new instance for which `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#contentIsMalformed()` is true and `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#dataType()` is `https://developer.android.com/reference/kotlin/androidx/media3/common/C#DATA_TYPE_MEDIA()`.

| Parameters |
|---|---|
| `message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | See `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#getMessage()`. |
| `cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?` | See `https://developer.android.com/reference/java/lang/Throwable.html#getCause()`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException!` | The created instance. |

### createForMalformedDataOfUnknownType

```
java-static fun createForMalformedDataOfUnknownType(message: String?, cause: Throwable?): ParserException!
```

Creates a new instance for which `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#contentIsMalformed()` is true and `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#dataType()` is `https://developer.android.com/reference/kotlin/androidx/media3/common/C#DATA_TYPE_UNKNOWN()`.

| Parameters |
|---|---|
| `message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | See `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#getMessage()`. |
| `cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?` | See `https://developer.android.com/reference/java/lang/Throwable.html#getCause()`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException!` | The created instance. |

### createForMalformedManifest

```
java-static fun createForMalformedManifest(message: String?, cause: Throwable?): ParserException!
```

Creates a new instance for which `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#contentIsMalformed()` is true and `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#dataType()` is `https://developer.android.com/reference/kotlin/androidx/media3/common/C#DATA_TYPE_MANIFEST()`.

| Parameters |
|---|---|
| `message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | See `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#getMessage()`. |
| `cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?` | See `https://developer.android.com/reference/java/lang/Throwable.html#getCause()`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException!` | The created instance. |

### createForMalformedSteeringManifest

```
java-static fun createForMalformedSteeringManifest(message: String?, cause: Throwable?): ParserException!
```

Creates a new instance for which `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#contentIsMalformed()` is true and `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#dataType()` is `https://developer.android.com/reference/kotlin/androidx/media3/common/C#DATA_TYPE_STEERING_MANIFEST()`.

| Parameters |
|---|---|
| `message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | See `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#getMessage()`. |
| `cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?` | See `https://developer.android.com/reference/java/lang/Throwable.html#getCause()`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException!` | The created instance. |

### createForManifestWithUnsupportedFeature

```
java-static fun createForManifestWithUnsupportedFeature(
    message: String?,
    cause: Throwable?
): ParserException!
```

Creates a new instance for which `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#contentIsMalformed()` is false and `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#dataType()` is `https://developer.android.com/reference/kotlin/androidx/media3/common/C#DATA_TYPE_MANIFEST()`.

| Parameters |
|---|---|
| `message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | See `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#getMessage()`. |
| `cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?` | See `https://developer.android.com/reference/java/lang/Throwable.html#getCause()`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException!` | The created instance. |

### createForUnsupportedContainerFeature

```
java-static fun createForUnsupportedContainerFeature(message: String?): ParserException!
```

Creates a new instance for which `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#contentIsMalformed()` is false and `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#dataType()` is `https://developer.android.com/reference/kotlin/androidx/media3/common/C#DATA_TYPE_MEDIA()`.

| Parameters |
|---|---|
| `message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | See `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException#getMessage()`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/ParserException!` | The created instance. |

### getMessage

```
fun getMessage(): String!
```

## Public properties

### contentIsMalformed

```
val contentIsMalformed: Boolean
```

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

```
val dataType: Int
```

The `https://developer.android.com/reference/kotlin/androidx/media3/common/C.DataType` of the parsed bitstream.