CakeTaskBuilderExtensions.

OnError<TData>(CakeTaskBuilder, Action<TData>) Method

Summary

Adds an error handler to be executed if an exception occurs in the task.
Namespace
Cake.Core
Containing Type
CakeTaskBuilderExtensions

Syntax

public static CakeTaskBuilder OnError<TData>(this CakeTaskBuilder builder, Action<TData> errorHandler) 
    where TData : class

Type Parameters

Name Description
TData The extra data to operate with inside the error handler.

Parameters

Name Type Description
builder CakeTaskBuilder The builder.
errorHandler Action<TData> The error handler.

Return Value

Type Description
CakeTaskBuilder The same CakeTaskBuilder instance so that multiple calls can be chained.