By default an error is logged when I abort a pipeline in Sitecore XC9.

For example;

context.Abort("Abort pipeline", context);

Sometimes I want to abort a pipeline without logging an error, i.e. when it's valid to preempt the execution of the pipeline.

How to do this?

  • 1
    @Dan Sinclair why did you remove the sitecore-commerce tag?
    – Joost
    Commented Nov 28, 2018 at 13:46
  • Because this is not a commerce-specific question/solution. This appears to apply to any pipeline abort command; is that right? Commented Nov 28, 2018 at 14:26
  • 1
    No this is for XC only
    – Mark Cassidy
    Commented Nov 28, 2018 at 15:55

1 Answer 1


Add a magic "Ok|" string to the abort message, e.g:

context.Abort("Ok|Abort pipeline", context);

It turns out that the implementation of Abort checks for the magic "Ok|" string:

public override void Abort(string message, object context)
   base.Abort(message, context);
   if (message.Contains("Ok|"))
   this.Logger.LogError(string.Format("PipelineAbort:{0}", (object) message), Array.Empty());
  • 1
    wow, nice catch Commented Nov 28, 2018 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.