File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -793,14 +793,7 @@ def runTest( ) {
793
793
}
794
794
}
795
795
} catch (Exception e) {
796
- echo " An error occurred: ${ e.message} "
797
- if (e. toString(). contains(" FlowInterruptedException" )) {
798
- wasAborted = true
799
- currentBuild. result = ' ABORTED'
800
- echo " Build aborted by user or another trigger."
801
- } else {
802
- currentBuild. result = ' FAILURE'
803
- }
796
+ handleException(e)
804
797
} finally {
805
798
// Cleanup: Terminate any running processes if the build was aborted
806
799
if (wasAborted || currentBuild. result == ' ABORTED' ) {
@@ -839,6 +832,17 @@ def runTest( ) {
839
832
}
840
833
}
841
834
835
+ def handleException (Exception e ) {
836
+ // Handle exceptions and set build status accordingly
837
+ echo " An error occurred: ${ e.message} "
838
+ if (e. toString(). contains(" FlowInterruptedException" )) {
839
+ currentBuild. result = ' ABORTED'
840
+ echo " Build aborted by user or another trigger."
841
+ } else {
842
+ currentBuild. result = ' FAILURE'
843
+ }
844
+ }
845
+
842
846
def checkTestResults (results ) {
843
847
if (results. isEmpty()) {
844
848
return
You can’t perform that action at this time.
0 commit comments