# TrySetException(Exception)

> Raise completion with an exception.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.6/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public bool TrySetException(Exception exception)
```

### Parameters

**** (\[Exception]\(https\://learn.microsoft.com/dotnet/api/system.exception)): Exception to raise in the continuation.

### Returns

| Type                                                          | Description                                          |
| ------------------------------------------------------------- | ---------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Indicates if the completion was successfully raised. |
