griddynamics/mpl

FlowInterruptedException should not be wrapped

Closed this issue · 1 comments

Currently, all exceptions which occur during module execution are wrapped inside a MPLModuleException. Unfortunately, this also occurs for org.jenkinsci.plugins.workflow.steps.FlowInterruptedException which is used by Jenkins to abort a running build (e. g. manually aborted by the user or timeouts). Since the exception which is caught in the end by Jenkins is of a different type as expected, Jenkins interprets it as a build failure.

An excerpt of a current log file with an timeout occuring during build:

[Pipeline] End of Pipeline
com.griddynamics.devops.mpl.MPLModuleException: Found error during execution of the module 'library:MDSD.tools Lib/resources/tools/mdsd/devops/pipeline/stages/impl/constraintBuild/modules/Build/Build.groovy':
org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
Finished: FAILURE

when the exception is not wrapped the log looks like:

[Pipeline] End of Pipeline
Timeout has been exceeded
Finished: ABORTED`

Yeah, I think it's a good point - thank you for the contribution)