# ScheduledTask.AbortAsync(string, CancellationToken)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.scheduledtask/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.scheduledtask/methods/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable.Abstractions/ScheduledTask.cs#L209-L210)

```csharp
public ValueTask AbortAsync(string reason, CancellationToken cancellationToken = default(CancellationToken))
```

Administratively aborts the task: the host terminalizes it and its attached descendants as failed with a [DurableTaskAbortedException](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.durabletaskabortedexception/) carrying `reason`, without running further task code.

### Parameters

- `reason` (`string`): The reason for the abort, recorded as the exception message.
- `cancellationToken` (`CancellationToken`): A token which abandons waiting for the abort to commit.

### Exceptions

- `System.ArgumentException`: `reason` is `null`, empty, or whitespace.
- `System.NotSupportedException`: The host doesn't support aborting tasks.
