Failure Actions

Top  Previous  Next

 

A Pipeline is necessarily sequential, and therefore by default any command failure causes Pipeline Runner to abort the process and report the failure in the chosen manner. As a general rule this is the absolutely the desired result, but there are situations where the entire pipeline being aborted and optionally all the actions taken reversed is not desirable for some non-essential commands. For example if a failure occurs when sending an email notification after completion of the entire script case simply reporting the failure might well be preferable to aborting the entire process and potentially rolling back all the changes that were made if you have included such behaviour in your script.

 

In order to allow for this Pipeline Runner has a Setup Section Variable and a Notification Section Variable in each case called FailureAction which can be assigned in scripts to affect this behaviour.

 

There are two possible values for a Failure Action variable:

 

Abort

This is the default value, and when this value is set any failure will result in the currently running script being terminated.

 

Continue

This is the alternative value, and when this value is set any failure will be reported but processing of the script will continue.

lamp IMPORTANT: As a general rule you should not modify this value without a very good reason. If you decide to use this feature, you should do so in matched Assign Command pairs i.e. assign FailureAction.Continue, then process the operation, then assign FailureAction.Abort immediately after to avoid the potential for unintended behaviour.

Examples

 

Ignore a specific error inside a User Section

 

[Delete Directory]

 

; Turn off the standard failure action by setting the variable value to Continue

Assign:FailureAction,Continue

 

; Attempt to delete a directory that does not exist

DeleteDirectory:"z:\notexisting"

 

; Turn the standard failure action on again by setting the variable value to Abort

Assign:FailureAction,Abort

 

Ignore Email Notification Errors

 

[Notification]

 

; Turn off the standard failure action by setting the variable value to Continue

Var:FailureAction=Continue

 

; Assign other notification values

Var:MailErrorBody="Something went very wrong with the %%ProjectName%% pipeline!"

Var:MailReplyTo=support@mywebsite.com 

Var:MailFrom=support@mywebsite.com 

Var:MailReplyTo=support@mywebsite.com 

Var:MailSender=support@mywebsite.com 

Var:MailSubject= "%%ProjectName%% - Error Status"

Var:MailSuccessBody="The %%ProjectName%% pipeline completed successfully!"

Var:MailTo=david@somecompany.co.uk

Var:NotificationType=Email

Var:Notify=OnErrorAndSuccess

 

See Also: Setup Section Variables Assign Command