Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 9cc9197

Browse files
committed
Address Abhisheks review comments
1 parent 9162a21 commit 9cc9197

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/main/java/com/mathworks/ci/MatlabCommandStepExecution.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@ public Void run() throws Exception {
4545

4646
int exitCode = execMatlabCommand(workspace, launcher, listener, env);
4747

48-
if(exitCode == 0){
49-
getContext().setResult(Result.SUCCESS);
50-
return null;
48+
if(exitCode != 0){
49+
// throw an exception if return code is non-zero
50+
stop(new MatlabExecutionException(exitCode));
5151
}
5252

53-
// throw an exception if return code is non-zero
54-
stop(new MatlabExecutionException(exitCode));
53+
getContext().setResult(Result.SUCCESS);
5554
return null;
5655
}
5756

src/main/java/com/mathworks/ci/MatlabRunTestsStepExecution.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,12 @@ public Void run() throws Exception {
4444

4545
int exitCode = execMatlabCommand(workspace, launcher, listener, env);
4646

47-
if(exitCode == 0){
48-
getContext().setResult(Result.SUCCESS);
49-
return null;
47+
if(exitCode != 0){
48+
// throw an exception if return code is non-zero
49+
stop(new MatlabExecutionException(exitCode));
5050
}
5151

52-
// throw an exception if returned exit code is non-zero
53-
stop(new MatlabExecutionException(exitCode));
52+
getContext().setResult(Result.SUCCESS);
5453
return null;
5554
}
5655

0 commit comments

Comments
 (0)