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( ) {
793793 }
794794 }
795795 } 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)
804797 } finally {
805798 // Cleanup: Terminate any running processes if the build was aborted
806799 if (wasAborted || currentBuild. result == ' ABORTED' ) {
@@ -839,6 +832,17 @@ def runTest( ) {
839832 }
840833}
841834
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+
842846def checkTestResults (results ) {
843847 if (results. isEmpty()) {
844848 return
You can’t perform that action at this time.
0 commit comments