Skip to content

Commit

Permalink
Fixed exit code logic
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonioG70 authored and hmiguim committed Feb 22, 2024
1 parent 5b5db13 commit 096ca78
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 096ca78

Please sign in to comment.