Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed exit code logic #564

Merged
merged 1 commit into from
Feb 22, 2024
Merged
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
5 changes: 3 additions & 2 deletions dbptk-core/src/main/java/com/databasepreservation/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static int internalMain(CLI cli) {
logProgramStart();
cli.logOperatingSystemInfo();

int exitStatus = EXIT_CODE_GENERIC_ERROR;
int exitStatus = EXIT_CODE_OK;

// avoid SAX processing limit of 50 million elements
System.setProperty("totalEntitySizeLimit", "0");
Expand All @@ -112,7 +112,7 @@ public static int internalMain(CLI cli) {
if (!cli.getRecognizedCommand()) {
LOGGER.error("Command '{}' not a valid command.", cli.getArgCommand());
cli.printUsage();
exitStatus = EXIT_CODE_OK;
exitStatus = EXIT_CODE_GENERIC_ERROR;
} else {
if (cli.usingUTF8()) {
if (isGUI) {
Expand Down Expand Up @@ -190,6 +190,7 @@ private static int runValidation(CLIValidate cli, CLIHelp help) {
LOGGER.info("Validate SIARD at '{}'", cli.getSIARDPackage());
siardValidation.validate();
duration = System.currentTimeMillis() - startTime;
exitStatus = EXIT_CODE_OK;
LOGGER.info("Validate SIARD took {}m {}s to complete.", duration / 60000, duration % 60000 / 1000);
} catch (SiardNotFoundException e) {
LOGGER.error("{}: {}", e.getMessage(), e.getPath());
Expand Down
Loading