Skip to content
Discussion options

You must be logged in to vote

@StefanOssendorf kind of. You can override OnError in the task that fails (not the following) and make Cake not abort the build on that error.

As an example:

using System;
using Cake.Common.Diagnostics;
using Cake.Core;
using Cake.Frosting;

public static class Program
{
    public static int Main(string[] args)
    {
        return new CakeHost()
            .Run(args);
    }
}

[TaskName("WillFail")]
public sealed class WillFailTask : FrostingTask
{
    public override void Run(ICakeContext context)
    {
        throw new Exception("Boom!");
    }

    public override void OnError(Exception exception, ICakeContext context)
    {
        context.Information($"Well, well, an error of {ex…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@nils-a
Comment options

@StefanOssendorf
Comment options

@devlead
Comment options

@nils-a
Comment options

@StefanOssendorf
Comment options

Answer selected by StefanOssendorf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants