# CancelData

Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0

<div class="api-meta">
<span class="api-kind api-kind-class" data-pagefind-filter="kind:Class">Class</span>
<span data-pagefind-filter="namespace:Sansar.Script">Namespace <a href="/scripting/api/sansar.script"><code>Sansar.Script</code></a></span>
<span>Inherits <a href="/scripting/api/sansar.script/eventdata">EventData</a></span>
</div>

<span id="T:Sansar.Script.CancelData"></span>

The event is sent when a subscription is canceled.

```csharp
public class CancelData : EventData
```

## Remarks

Coroutines in a WaitFor will capture this event and throw [`WaitCanceledException`](/scripting/api/global/waitcanceledexception).

## Members at a glance

| Kind | Members |
|---|---|
| **Properties** | [Message](#message) · [Reason](#reason) |

## Properties

### Message

<div class="api-card">
<span id="P:Sansar.Script.CancelData.Message"></span>

```csharp signature
public string Message { get; }
```

String description of the error condition.

**Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The error message string.

<details class="api-remarks"><summary>Remarks</summary>

Useful for debugging.

</details>

</div>

### Reason

<div class="api-card">
<span id="P:Sansar.Script.CancelData.Reason"></span>

```csharp signature
public int Reason { get; }
```

Integer error code. The value varies depending on the method called.

**Value:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — Error message int reason.

<details class="api-remarks"><summary>Remarks</summary>

See the documentation for the Subscribe method for details.

</details>

</div>


## Used in examples

- [CommandExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CommandExample.cs)

<p class="api-generated" data-pagefind-ignore>Generated from the Sansar 47.10.0 client ScriptApi snapshot.</p>