Ejemplo n.º 1
0
  /**
   * Print a message
   *
   * @param ex exception to be printed out
   */
  protected void printMessage(LaunchException ex) {
    StringBuilder result = new StringBuilder();
    result.append("netx: ");
    result.append(ex.getCategory());
    if (ex.getSummary() != null) {
      result.append(": ");
      result.append(ex.getSummary());
    }
    if (ex.getCause() != null) {
      result.append(recursiveDescription(ex.getCause()));
    }
    logger.log(OutputController.Level.MESSAGE_ALL, result.toString());

    logger.log(ex);
  }
Ejemplo n.º 2
0
 /**
  * Entry point for starting command line Ant.
  *
  * @param args commandline arguments
  */
 public static void main(String[] args) {
   int exitCode;
   try {
     Launcher launcher = new Launcher();
     exitCode = launcher.run(args);
   } catch (LaunchException e) {
     exitCode = EXIT_CODE_ERROR;
     System.err.println(e.getMessage());
   } catch (Throwable t) {
     exitCode = EXIT_CODE_ERROR;
     t.printStackTrace(System.err);
   }
   if (exitCode != 0) {
     if (launchDiag) {
       System.out.println("Exit code: " + exitCode);
     }
     System.exit(exitCode);
   }
 }