Skip to content

Commit 89627d6

Browse files
authored
Merge pull request #1509 from jjackson/fix/cli-exit-on-error
Fix CLI hanging on exceptions
2 parents 30aad9d + 8a452d0 commit 89627d6

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/cli/java/org/commcare/util/cli/CliMain.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ public static void main(String[] args) {
6161
return;
6262
}
6363

64-
cliCommand.handle();
64+
try {
65+
cliCommand.handle();
66+
} catch (Exception e) {
67+
System.err.println("\nCommand failed with error:");
68+
e.printStackTrace();
69+
System.exit(-1);
70+
}
6571
}
6672

6773
private static CliCommand getCliCommand(String commandName) throws CliCommandNotFound {

0 commit comments

Comments
 (0)