# DurableTaskAttemptCanceledException.DurableTaskAttemptCanceledException(DurableTaskAttemptCancellationReason, CancellationToken, Exception?)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.durabletaskattemptcanceledexception/) | [Constructors](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.durabletaskattemptcanceledexception/constructors/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable.Abstractions/DurableTaskAttemptCanceledException.cs#L88-L90)

```csharp
public DurableTaskAttemptCanceledException(DurableTaskAttemptCancellationReason reason, CancellationToken token, Exception? innerException = null)
```

Initializes an exception for an attempt canceled for `reason`, with a message which describes it.

### Parameters

- `reason` (`DurableTaskAttemptCancellationReason`): Why the host canceled the attempt.
- `token` (`CancellationToken`): The attempt's cancellation token.
- `innerException` (`Exception?`): The exception which the canceled operation threw, if any.
