Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions src/main/java/com/datastax/loader/CqlDelimUnload.java
Original file line number Diff line number Diff line change
Expand Up @@ -463,16 +463,25 @@ public boolean run(String[] args)
return true;
}

public static void main(String[] args)
throws IOException, ParseException, InterruptedException, ExecutionException,
KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException,
CertificateException, KeyManagementException {
CqlDelimUnload cdu = new CqlDelimUnload();
boolean success = cdu.run(args);
public static void main(String[] args) {
boolean success;

// If we don't catch all exceptions and force a System.exit(), it's possible there will be
// executor threads stuck in "a waiting for more tasks" state that will never exit.
try {
CqlDelimUnload cdu = new CqlDelimUnload();
success = cdu.run(args);
} catch (IOException | ParseException | InterruptedException | ExecutionException |
KeyStoreException | NoSuchAlgorithmException | UnrecoverableKeyException |
CertificateException | KeyManagementException e) {
success = false;
System.err.println("Fatal Exception: " + e.getMessage());
}

if (success) {
System.exit(0);
} else {
System.exit(-1);
System.exit(1);
}
}

Expand Down