# ChatGptOptions.ThrowExceptionOnError property

Gets or sets a value that determines whether to throw a [`ChatGptException`](../../ChatGptNet.Exceptions/ChatGptException.md) when an error occurred (default: `true`). If this property is set to `false`, API errors are returned in the [`ChatGptResponse`](../../ChatGptNet.Models/ChatGptResponse.md) object.

```csharp
public bool ThrowExceptionOnError { get; set; }
```

## See Also

* class [ChatGptException](../../ChatGptNet.Exceptions/ChatGptException.md)
* class [ChatGptResponse](../../ChatGptNet.Models/ChatGptResponse.md)
* class [ChatGptOptions](../ChatGptOptions.md)
* namespace [ChatGptNet](../../ChatGptNet.md)

<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
