# CoroutineException

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="https://learn.microsoft.com/dotnet/api/system.exception">Exception</a></span>
</div>

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

An exception occurred relating to Coroutine execution.

```csharp
public class CoroutineException : Exception
```

## Remarks

This exception is thrown when a coroutine method is called outside of a coroutine context (i.e. in a method that was not started with `ScriptBase.StartCoroutine`) or attempting to use the context of another script.



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