# Script Handle

### ScriptHandle Class

A running script in Sansar.

### Syntax

### Remarks

This is a lightweight handle which is used by some API methods to refer to a script.

### Requirements

**Namespace:** Sansar.Script\
**Assembly:** Sansar.Script (in Sansar.Script.dll)\
**Assembly Versions:** 1.0.0.0

### Members

See Also: Inherited members from [object](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Object).

### Public Properties

### Public Methods

### Public Events

|   | [**UnhandledException**](https://help.sansar.com/hc/en-us/articles/115003551048-ScriptHandle#E:Sansar.Script.ScriptHandle.UnhandledException) | Run by the script scheduler when the invocation of a script event handler or coroutine throws an exception. |
| - | --------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |

### Member Details

#### Dispose Method

> Internal use only
>
> #### Syntax
>
> public [void](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void) **Dispose** ()
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Script\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### ID Property

> The Sansar Script's unique ID. This ID is unique among all scripts currently running in a scene. It will change every time the script or scene is started.
>
> #### Syntax
>
> **Value**
>
> > Returns [ScriptId.Invalid](https://docs.sansar.com/latest/script-api-docs/sansar-script-namespace/pages/aGRf7YDf220Xo4vy13J3#F:Sansar.Script.ScriptId.Invalid) if the ScriptHandle is not initialized with a valid script.
>
> #### Remarks
>
> Internal.
>
> #### Requirements
>
> **Namespace:** Sansar.Script\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### UnhandledException Event

> Run by the script scheduler when the invocation of a script event handler or coroutine throws an exception.
>
> #### Syntax
>
> #### Remarks
>
> If [ScriptHandle.UnhandledExceptionRecoverable](https://help.sansar.com/hc/en-us/articles/115003551048#P:Sansar.Script.ScriptHandle.UnhandledExceptionRecoverable) is true then the script may continue running if the handler does not throw an exception. If the handler needs to stop execution of the script it should throw the passed exception. The first argument is either the [Sansar.Script.EventData](https://help.sansar.com/hc/en-us/articles/115003548788) that was being processed, or the Coroutine that was running when the exception occurred.
>
> #### Requirements
>
> **Namespace:** Sansar.Script\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### UnhandledExceptionRecoverable Property

> #### Syntax
>
> public [bool](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Boolean) **UnhandledExceptionRecoverable** { get; }
>
> **Value**
>
> > Boolean indicating if the script may continue running after an unhandled exception occurs.
>
> #### Remarks
>
> If this is true and the [ScriptHandle.UnhandledException](https://help.sansar.com/hc/en-us/articles/115003551048#E:Sansar.Script.ScriptHandle.UnhandledException) event is set and does not throw and exception the script will continue to be scheduled.
>
> #### Requirements
>
> **Namespace:** Sansar.Script\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sansar.com/latest/script-api-docs/sansar-script-namespace/script-handle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
