# SessionError

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

*** ** * ** ***


```
class SessionError
```

<br />

*** ** * ** ***

Provides information about a session error.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi @https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) @https://developer.android.com/reference/kotlin/androidx/annotation/IntDef(value = ) annotation https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError.Code` Info and error result codes. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#ERROR_BAD_VALUE() = -3` Error code representing that an argument is illegal. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#ERROR_INVALID_STATE() = -2` Error code representing that the command cannot be completed because the current state is not valid for the command. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#ERROR_IO() = -5` Error code representing that a file or network related error happened. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#ERROR_NOT_SUPPORTED() = -6` Error code representing that the command is not supported. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#ERROR_PERMISSION_DENIED() = -4` Error code representing that the command is not allowed. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#ERROR_SESSION_AUTHENTICATION_EXPIRED() = -102` Error code representing that the authentication has expired. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#ERROR_SESSION_CONCURRENT_STREAM_LIMIT() = -104` Error code representing that too many concurrent streams are detected. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#ERROR_SESSION_CONTENT_ALREADY_PLAYING() = -110` Error code representing that the requested content is already playing. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#ERROR_SESSION_DISCONNECTED() = -100` Error code representing that the session and controller were disconnected. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#ERROR_SESSION_END_OF_PLAYLIST() = -109` Error code representing that navigation failed because the playlist was exhausted. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#ERROR_SESSION_NOT_AVAILABLE_IN_REGION() = -106` Error code representing that the content is blocked due to being regionally unavailable. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#ERROR_SESSION_PARENTAL_CONTROL_RESTRICTED() = -105` Error code representing that the content is blocked due to parental controls. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#ERROR_SESSION_PREMIUM_ACCOUNT_REQUIRED() = -103` Error code representing that a premium account is required. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#ERROR_SESSION_SETUP_REQUIRED() = -108` Error code representing that the session needs user's manual intervention. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#ERROR_SESSION_SKIP_LIMIT_REACHED() = -107` Error code representing that the application cannot skip any more because the skip limit is reached. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#ERROR_UNKNOWN() = -1` Error code representing that the command is ended with an unknown error. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#INFO_CANCELLED() = 1` Info code representing that the command was cancelled. |

| ### Public constructors |
|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#SessionError(int,java.lang.String)(@https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError.Code code: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Creates an instance with `https://developer.android.com/reference/android/os/Bundle.html#EMPTY`. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#SessionError(int,java.lang.String,android.os.Bundle)(@https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError.Code code: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, extras: https://developer.android.com/reference/android/os/Bundle.html!)` Creates an instance. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#equals(java.lang.Object)(o: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` Checks the given error for equality while ignoring `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#extras()`. |
| `java-static https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#fromBundle(android.os.Bundle)(bundle: https://developer.android.com/reference/android/os/Bundle.html!)` Restores a `SessionError` from a `https://developer.android.com/reference/android/os/Bundle.html`. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#getErrorCodeName(int)(@https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError.Code errorCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the name of a given error code. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#hashCode()()` |
| `https://developer.android.com/reference/android/os/Bundle.html!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#toBundle()()` Returns a `https://developer.android.com/reference/android/os/Bundle.html` representing the information stored in this object. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi @https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError.Code https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#code()` |
| `https://developer.android.com/reference/android/os/Bundle.html!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#extras()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#message()` |

## Constants

### ERROR_BAD_VALUE

```
const val ERROR_BAD_VALUE = -3: Int
```

Error code representing that an argument is illegal.

### ERROR_INVALID_STATE

```
const val ERROR_INVALID_STATE = -2: Int
```

Error code representing that the command cannot be completed because the current state is not valid for the command.

### ERROR_IO

```
const val ERROR_IO = -5: Int
```

Error code representing that a file or network related error happened.

### ERROR_NOT_SUPPORTED

```
const val ERROR_NOT_SUPPORTED = -6: Int
```

Error code representing that the command is not supported.

### ERROR_PERMISSION_DENIED

```
const val ERROR_PERMISSION_DENIED = -4: Int
```

Error code representing that the command is not allowed.

### ERROR_SESSION_AUTHENTICATION_EXPIRED

```
const val ERROR_SESSION_AUTHENTICATION_EXPIRED = -102: Int
```

Error code representing that the authentication has expired.

### ERROR_SESSION_CONCURRENT_STREAM_LIMIT

```
const val ERROR_SESSION_CONCURRENT_STREAM_LIMIT = -104: Int
```

Error code representing that too many concurrent streams are detected.

### ERROR_SESSION_CONTENT_ALREADY_PLAYING

```
@UnstableApi
const val ERROR_SESSION_CONTENT_ALREADY_PLAYING = -110: Int
```

Error code representing that the requested content is already playing.

### ERROR_SESSION_DISCONNECTED

```
const val ERROR_SESSION_DISCONNECTED = -100: Int
```

Error code representing that the session and controller were disconnected.

### ERROR_SESSION_END_OF_PLAYLIST

```
@UnstableApi
const val ERROR_SESSION_END_OF_PLAYLIST = -109: Int
```

Error code representing that navigation failed because the playlist was exhausted.

### ERROR_SESSION_NOT_AVAILABLE_IN_REGION

```
const val ERROR_SESSION_NOT_AVAILABLE_IN_REGION = -106: Int
```

Error code representing that the content is blocked due to being regionally unavailable.

### ERROR_SESSION_PARENTAL_CONTROL_RESTRICTED

```
const val ERROR_SESSION_PARENTAL_CONTROL_RESTRICTED = -105: Int
```

Error code representing that the content is blocked due to parental controls.

### ERROR_SESSION_PREMIUM_ACCOUNT_REQUIRED

```
const val ERROR_SESSION_PREMIUM_ACCOUNT_REQUIRED = -103: Int
```

Error code representing that a premium account is required.

### ERROR_SESSION_SETUP_REQUIRED

```
const val ERROR_SESSION_SETUP_REQUIRED = -108: Int
```

Error code representing that the session needs user's manual intervention.

### ERROR_SESSION_SKIP_LIMIT_REACHED

```
const val ERROR_SESSION_SKIP_LIMIT_REACHED = -107: Int
```

Error code representing that the application cannot skip any more because the skip limit is reached.

### ERROR_UNKNOWN

```
const val ERROR_UNKNOWN = -1: Int
```

Error code representing that the command is ended with an unknown error.

### INFO_CANCELLED

```
const val INFO_CANCELLED = 1: Int
```

Info code representing that the command was cancelled.

## Public constructors

### SessionError

```
@UnstableApi
SessionError(@SessionError.Code code: Int, message: String!)
```

Creates an instance with `https://developer.android.com/reference/android/os/Bundle.html#EMPTY`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError.Code code: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The error result code. |
| `message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The error message. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the result code is not an error result code. |

### SessionError

```
@UnstableApi
SessionError(@SessionError.Code code: Int, message: String!, extras: Bundle!)
```

Creates an instance.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError.Code code: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The error result code. |
| `message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The error message. |
| `extras: https://developer.android.com/reference/android/os/Bundle.html!` | The error extras. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the result code is not an error result code. |

## Public functions

### equals

```
@UnstableApi
fun equals(o: Any?): Boolean
```

Checks the given error for equality while ignoring `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionError#extras()`.

### fromBundle

```
@UnstableApi
java-static fun fromBundle(bundle: Bundle!): SessionError!
```

Restores a `SessionError` from a `https://developer.android.com/reference/android/os/Bundle.html`.

### getErrorCodeName

```
@UnstableApi
java-static fun getErrorCodeName(@SessionError.Code errorCode: Int): String!
```

Returns the name of a given error code.

### hashCode

```
@UnstableApi
fun hashCode(): Int
```

### toBundle

```
@UnstableApi
fun toBundle(): Bundle!
```

Returns a `https://developer.android.com/reference/android/os/Bundle.html` representing the information stored in this object.

## Public properties

### code

```
@UnstableApi
@SessionError.Code
val code: Int
```

### extras

```
@UnstableApi
val extras: Bundle!
```

### message

```
@UnstableApi
val message: String!
```