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

[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#L102-L105)

```csharp
public DurableTaskAttemptCanceledException(string? message, Exception? innerException, DurableTaskAttemptCancellationReason reason, CancellationToken token)
```

Initializes an exception for an attempt canceled for `reason`.

### Parameters

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