java/sql-dk/src/info/globalcode/sql/dk/CLIStarter.java
branchv_0
changeset 149 6a6f7b384591
parent 146 4f4f515df807
child 155 eb3676c6929b
equal deleted inserted replaced
148:1b2f40cd432b 149:6a6f7b384591
    56 	public static final int EXIT_SQL_ERROR = 3; // doc:SQL error
    56 	public static final int EXIT_SQL_ERROR = 3; // doc:SQL error
    57 	public static final int EXIT_CLI_PARSE_ERROR = 4; // doc:CLI options parse error
    57 	public static final int EXIT_CLI_PARSE_ERROR = 4; // doc:CLI options parse error
    58 	public static final int EXIT_CLI_VALIDATE_ERROR = 5; // doc:CLI options validation error
    58 	public static final int EXIT_CLI_VALIDATE_ERROR = 5; // doc:CLI options validation error
    59 	public static final int EXIT_CONFIGURATION_ERROR = 6; // doc:configuration error
    59 	public static final int EXIT_CONFIGURATION_ERROR = 6; // doc:configuration error
    60 	public static final int EXIT_FORMATTING_ERROR = 7; // doc:formatting error
    60 	public static final int EXIT_FORMATTING_ERROR = 7; // doc:formatting error
       
    61 	public static final int EXIT_BATCH_ERROR = 8; // doc:batch error
    61 	private static final Logger log = Logger.getLogger(CLIStarter.class.getName());
    62 	private static final Logger log = Logger.getLogger(CLIStarter.class.getName());
    62 	private CLIOptions options;
    63 	private CLIOptions options;
    63 	private Configuration configuration;
    64 	private Configuration configuration;
    64 
    65 
    65 	public static void main(String[] args) {
    66 	public static void main(String[] args) {
   100 		} catch (FormatterException e) {
   101 		} catch (FormatterException e) {
   101 			log.log(Level.SEVERE, "Formatting problem", e);
   102 			log.log(Level.SEVERE, "Formatting problem", e);
   102 			exitCode = EXIT_FORMATTING_ERROR;
   103 			exitCode = EXIT_FORMATTING_ERROR;
   103 		} catch (BatchException e) {
   104 		} catch (BatchException e) {
   104 			log.log(Level.SEVERE, "Batch problem", e);
   105 			log.log(Level.SEVERE, "Batch problem", e);
   105 			exitCode = EXIT_FORMATTING_ERROR;
   106 			exitCode = EXIT_BATCH_ERROR;
   106 		}
   107 		}
   107 
   108 
   108 		System.exit(exitCode);
   109 		System.exit(exitCode);
   109 	}
   110 	}
   110 
   111