# DurableTaskRejectedException

Package: [Microsoft.Orleans.Durable](/orleans/docs/api/csharp/microsoft.orleans.durable/) 10.0.0-alpha.1

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable/DurableTasks/DurableTaskRejectedException.cs#L19)

```csharp
[Orleans.GenerateSerializer]
[Orleans.Alias(Orleans.Durable.Tasks.DurableTaskRejectedException)]
public sealed class DurableTaskRejectedException : Exception
```

Represents the start of a durable task whose grain permanently rejected the invocation for a reason other than a conflict, which it reports with a rejection code of its own, or without one.

## Remarks

The task's grain dead-lettered the invocation and stored nothing for it, so the starter's record of the task fails with this exception: awaiting the task, or a `ScheduleAsync` which awaits its acceptance, throws it, in every replay. A rejection for a conflicting task identifier fails with [DurableTaskConflictException](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.tasks.durabletaskconflictexception/) instead. A rejection with the [DurableTaskRejectionCodes](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.tasks.durabletaskrejectioncodes/) code leaves the outcome unknown: the grain may have run the task, and deleted it after its retention, before the late delivery arrived.

## Constructors

- [DurableTaskRejectedException(TaskId, GrainId, string?, string)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.tasks.durabletaskrejectedexception/constructors/constructor-orleans-durable-tasks-taskid-orleans-runtime-grainid-string-nullable-d6d95b0a/)

## Properties

- [Code](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.tasks.durabletaskrejectedexception/properties/code-53da368e/)
- [Target](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.tasks.durabletaskrejectedexception/properties/target-fc507dae/)
- [TaskId](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.tasks.durabletaskrejectedexception/properties/taskid-c731be4d/)
