Summary
Adds an error handler to be executed if an exception occurs in the task.
Syntax
public static CakeTaskBuilder OnError<TData>(this CakeTaskBuilder builder, Func<TData, Task> errorHandler)
where TData : class
Examples
Task("Risky")
.OnError<Foo>(async data =>
{
Error(data.Place);
await System.Threading.Tasks.Task.CompletedTask;
})
.Does(() => { });
Type Parameters
| Name |
Description |
| TData |
The extra data to operate with inside the error handler. |
Parameters
| Name |
Type |
Description |
| builder |
CakeTaskBuilder |
The builder. |
| errorHandler |
Func<TData, Task> |
The error handler. |
Return Value