Skip to content

Commit d273f9d

Browse files
make CI failure with unexpected result
-- Initialize real result with optional empty so that test can wait for right result and pass.
1 parent b36439e commit d273f9d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

examples/java-matter-controller/java/src/com/matter/controller/Main.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,13 @@ public static void main(String[] args) {
112112

113113
try {
114114
commandManager.run(args);
115-
} catch (IllegalArgumentException e) {
115+
}
116+
catch (IllegalArgumentException e) {
116117
logger.log(Level.INFO, "Arguments init failed with exception: " + e.getMessage());
118+
System.exit(1);
117119
} catch (Exception e) {
118120
logger.log(Level.INFO, "Run command failed with exception: " + e.getMessage());
121+
System.exit(1);
119122
}
120123
controller.shutdownCommissioning();
121124
}

examples/java-matter-controller/java/src/com/matter/controller/commands/common/CommandManager.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public final void register(String clusterName, ArrayList<Command> commandsList)
3636
mClusters.put(clusterName, commandsList);
3737
}
3838

39-
public final void run(String[] args) {
39+
public final void run(String[] args) throws Exception {
4040
Command command;
4141

4242
if (args.length < 1) {
@@ -102,8 +102,10 @@ public final void run(String[] args) {
102102
} catch (IllegalArgumentException e) {
103103
System.out.println("Run command failed with exception: " + e.getMessage());
104104
showCommand(args[0], command);
105+
throw e;
105106
} catch (Exception e) {
106107
logger.log(Level.INFO, "Run command failed with exception: " + e.getMessage());
108+
throw e;
107109
}
108110
}
109111

0 commit comments

Comments
 (0)