# TerminationInfo

# TerminationInfo

Artifact:[androidx.javascriptengine:javascriptengine](https://developer.android.com/jetpack/androidx/releases/javascriptengine)  
[View Source](https://cs.android.com/search?q=file:androidx/javascriptengine/TerminationInfo.java+class:androidx.javascriptengine.TerminationInfo)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/javascriptengine#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/javascriptengine/TerminationInfo "View this page in Java")

<br />

```
class TerminationInfo
```

<br />

*** ** * ** ***

Information about how and why an isolate has terminated.

## Summary

|                                    ### Constants                                    |
|-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [STATUS_MEMORY_LIMIT_EXCEEDED](https://developer.android.com/reference/kotlin/androidx/javascriptengine/TerminationInfo#STATUS_MEMORY_LIMIT_EXCEEDED())` = 3` The isolate exceeded its heap size limit.                        |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [STATUS_SANDBOX_DEAD](https://developer.android.com/reference/kotlin/androidx/javascriptengine/TerminationInfo#STATUS_SANDBOX_DEAD())` = 2` The whole sandbox died (or was closed), taking this isolate with it.               |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [STATUS_UNKNOWN_ERROR](https://developer.android.com/reference/kotlin/androidx/javascriptengine/TerminationInfo#STATUS_UNKNOWN_ERROR())` = 1` The isolate (but not necessarily the sandbox) has crashed for an unknown reason. |

|                               ### Public functions                                |
|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | [getMessage](https://developer.android.com/reference/kotlin/androidx/javascriptengine/TerminationInfo#getMessage())`()` Get the message associated with this termination.      |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)       | [getStatus](https://developer.android.com/reference/kotlin/androidx/javascriptengine/TerminationInfo#getStatus())`()` Get the status code of the termination.                  |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | [getStatusString](https://developer.android.com/reference/kotlin/androidx/javascriptengine/TerminationInfo#getStatusString())`()` Describe the status code of the termination. |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | [toString](https://developer.android.com/reference/kotlin/androidx/javascriptengine/TerminationInfo#toString())`()` Describe the termination.                                  |

## Constants

### STATUS_MEMORY_LIMIT_EXCEEDED

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/javascriptengine#1.0.0)  

```
const val STATUS_MEMORY_LIMIT_EXCEEDED = 3: Int
```

The isolate exceeded its heap size limit.

The isolate may continue to hold onto resources (even if explicitly closed) until the sandbox has been shutdown. If necessary, restart the sandbox at the earliest opportunity in order to reclaim these resources.

Note that memory exhaustion will kill the whole sandbox, so any other isolates within the same sandbox will be terminated with[STATUS_SANDBOX_DEAD](https://developer.android.com/reference/kotlin/androidx/javascriptengine/TerminationInfo#STATUS_SANDBOX_DEAD()).  

### STATUS_SANDBOX_DEAD

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/javascriptengine#1.0.0)  

```
const val STATUS_SANDBOX_DEAD = 2: Int
```

The whole sandbox died (or was closed), taking this isolate with it.  

### STATUS_UNKNOWN_ERROR

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/javascriptengine#1.0.0)  

```
const val STATUS_UNKNOWN_ERROR = 1: Int
```

The isolate (but not necessarily the sandbox) has crashed for an unknown reason.  

## Public functions

### getMessage

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/javascriptengine#1.0.0)  

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

Get the message associated with this termination. The content or format of these messages is not stable between JavaScriptEngine versions.  

|                                      Returns                                      |
|-----------------------------------------------------------------------------------|------------------------------------------------|
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | a human-readable message about the termination |

### getStatus

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/javascriptengine#1.0.0)  

```
fun getStatus(): Int
```

Get the status code of the termination.

New status codes may be added with new JavaScriptEngine versions.  

|                                   Returns                                   |
|-----------------------------------------------------------------------------|------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the status code of the termination |

### getStatusString

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/javascriptengine#1.0.0)  

```
fun getStatusString(): String
```

Describe the status code of the termination. These strings are not stable between JavaScriptEngine versions.  

|                                      Returns                                      |
|-----------------------------------------------------------------------------------|-----------------------------------------------------|
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | a description of the status code of the termination |

### toString

```
fun toString(): String
```

Describe the termination. The content or format of this description is not stable between JavaScriptEngine versions.  

|                                      Returns                                      |
|-----------------------------------------------------------------------------------|-------------------------------------------------|
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | a human-readable description of the termination |