Example usage for java.lang IllegalArgumentException getLocalizedMessage

List of usage examples for java.lang IllegalArgumentException getLocalizedMessage

Introduction

In this page you can find the example usage for java.lang IllegalArgumentException getLocalizedMessage.

Prototype

public String getLocalizedMessage() 

Source Link

Document

Creates a localized description of this throwable.

Usage

From source file:fr.cs.examples.bodies.Phasing.java

/** Program entry point.
 * @param args program arguments//from   w ww .j  a v a2 s .  co  m
 */
public static void main(String[] args) {
    try {

        if (args.length != 1) {
            System.err.println("usage: java fr.cs.examples.bodies.Phasing filename");
            System.exit(1);
        }

        // configure Orekit
        Autoconfiguration.configureOrekit();

        // input/out
        URL url = Phasing.class.getResource("/" + args[0]);
        if (url == null) {
            System.err.println(args[0] + " not found");
            System.exit(1);
        }
        File input = new File(url.toURI().getPath());

        new Phasing().run(input);

    } catch (URISyntaxException use) {
        System.err.println(use.getLocalizedMessage());
        System.exit(1);
    } catch (IOException ioe) {
        System.err.println(ioe.getLocalizedMessage());
        System.exit(1);
    } catch (IllegalArgumentException iae) {
        iae.printStackTrace(System.err);
        System.err.println(iae.getLocalizedMessage());
        System.exit(1);
    } catch (ParseException pe) {
        System.err.println(pe.getLocalizedMessage());
        System.exit(1);
    } catch (OrekitException oe) {
        oe.printStackTrace(System.err);
        System.err.println(oe.getLocalizedMessage());
        System.exit(1);
    }
}

From source file:com.srini.hadoopYarn.Client.java

/**
 * @param args Command line arguments //from w w w  . j  a  v  a2s. c  om
 */
public static void main(String[] args) {
    boolean result = false;
    try {
        Client client = new Client();
        LOG.info("Initializing Client");
        try {
            boolean doRun = client.init(args);
            if (!doRun) {
                System.exit(0);
            }
        } catch (IllegalArgumentException e) {
            System.err.println(e.getLocalizedMessage());
            client.printUsage();
            System.exit(-1);
        }
        result = client.run();
    } catch (Throwable t) {
        LOG.fatal("Error running CLient", t);
        System.exit(1);
    }
    if (result) {
        LOG.info("Application completed successfully");
        System.exit(0);
    }
    LOG.error("Application failed to complete successfully");
    System.exit(2);
}

From source file:com.flyhz.avengers.framework.AvengersClient.java

/**
 * @param args/*  ww  w.j a v  a 2  s. c  o m*/
 *            Command line arguments
 */
public static void main(String[] args) {
    boolean result = false;
    try {
        AvengersClient client = new AvengersClient();
        LOG.info("Initializing Client");
        try {
            boolean doRun = client.init(args);
            if (!doRun) {
                System.exit(0);
            }
        } catch (IllegalArgumentException e) {
            System.err.println(e.getLocalizedMessage());
            client.printUsage();
            System.exit(-1);
        }
        for (Entry<String, List<String>> entry : client.avengersProcessCmds.entrySet()) {
            result = client.run(entry.getKey(), entry.getValue());
            if (!result)
                break;
        }

    } catch (Throwable t) {
        LOG.error("Error running CLient", t);
        System.exit(1);
    }
    if (result) {
        LOG.info("Application completed successfully");
        System.exit(0);
    }
    LOG.error("Application failed to complete successfully");
    System.exit(2);
}

From source file:com.sogou.dockeronyarn.client.DockerClient.java

/**
 * @param args Command line arguments // w  w  w.ja v a 2s .  co m
 */
public static void main(String[] args) {
    boolean result = false;
    try {
        DockerClient client = new DockerClient();
        LOG.info("Initializing Client");
        try {
            boolean doRun = client.init(args);
            if (!doRun) {
                System.exit(0);
            }
        } catch (IllegalArgumentException e) {
            System.err.println(e.getLocalizedMessage());
            client.printUsage();
            System.exit(-1);
        }
        //result = client.run();
    } catch (Throwable t) {
        LOG.fatal("Error running CLient", t);
        System.exit(1);
    }
    if (result) {
        LOG.info("Application completed successfully");
        System.exit(0);
    }
    LOG.error("Application failed to complete successfully");
    System.exit(2);
}

From source file:com.scistor.dshell.ScistorClient.java

/**
 * @param args//  w w w  .j  av a  2  s .c  om
 *            Command line arguments
 */
public static void main(String[] args) {
    boolean result = false;
    try {
        ScistorClient client = new ScistorClient();
        LOG.info("Initializing Client");
        try {
            boolean doRun = client.init(args);
            if (!doRun) {
                System.exit(0);
            }
        } catch (IllegalArgumentException e) {
            System.err.println(e.getLocalizedMessage());
            client.printUsage();
            System.exit(-1);
        }
        result = client.run();
    } catch (Throwable t) {
        LOG.fatal("Error running CLient", t);
        System.exit(1);
    }
    if (result) {
        LOG.info("Application completed successfully");
        System.exit(0);
    }
    LOG.error("Application failed to complete successfully");
    System.exit(2);
}

From source file:com.bigjob.Client.java

/**
 * @param args Command line arguments /*from   w  ww . j  a  v  a 2s . c o  m*/
 */
public static void main(String[] args) {
    boolean result = false;
    try {
        Client client = new Client();

        LOG.info("Initializing Client");
        try {
            boolean doRun = client.init(args);
            if (!doRun) {
                System.exit(0);
            }
        } catch (IllegalArgumentException e) {
            System.err.println(e.getLocalizedMessage());
            client.printUsage();
            System.exit(-1);
        }
        result = client.run();
    } catch (Throwable t) {
        LOG.fatal("Error running CLient", t);
        System.exit(1);
    }
    if (result) {
        LOG.info("Application submitted successfully");
        System.exit(0);
    }
    LOG.error("Application failed to complete successfully");
    System.exit(2);
}

From source file:hadoop.yarn.distributedshell.DshellClient.java

/**
 * @param args//w  ww  .  j av  a  2 s.c  o  m
 *            Command line arguments
 */
public static void main(String[] args) {
    boolean result = false;
    try {
        DshellClient client = new DshellClient();
        LOG.info("Initializing Client");
        try {
            boolean doRun = client.init(args);
            if (!doRun) {
                System.exit(0);
            }
        } catch (IllegalArgumentException e) {
            System.err.println(e.getLocalizedMessage());
            client.printUsage();
            System.exit(-1);
        }
        result = client.run();
    } catch (Throwable t) {
        LOG.fatal("Error running CLient", t);
        System.exit(1);
    }
    if (result) {
        LOG.info("Application completed successfully");
        System.exit(0);
    }
    LOG.error("Application failed to complete successfully");
    System.exit(2);
}

From source file:io.hops.tensorflow.Client.java

/**
 * @param args//from   www .j a v  a  2 s  .  c o  m
 *     Command line arguments
 */
public static void main(String[] args) {
    boolean result = false;
    try {
        Client client = new Client();
        LOG.info("Initializing Client");
        try {
            boolean doRun = client.init(args);
            if (!doRun) {
                System.exit(0);
            }
        } catch (IllegalArgumentException e) {
            System.err.println(e.getLocalizedMessage());
            System.exit(-1);
        }
        result = client.run();
    } catch (Throwable t) {
        LOG.fatal("Error running Client", t);
        System.exit(1);
    }
    if (result) {
        LOG.info("Application completed successfully");
        System.exit(0);
    }
    LOG.error("Application failed to complete successfully");
    System.exit(2);
}

From source file:org.apache.hadoop.yarn.applications.amonly.Client.java

/**
 * @param args Command line arguments //from ww  w  .  ja  va  2s.  co  m
 */
public static void main(String[] args) {
    boolean result = false;
    try {
        Client client = new Client();
        LOG.info("Initializing Client");
        try {
            boolean doRun = client.init(args);
            if (!doRun) {
                System.exit(0);
            }
        } catch (IllegalArgumentException e) {
            System.err.println(e.getLocalizedMessage());
            client.printUsage();
            System.exit(-1);
        }
        result = client.run();
    } catch (Throwable t) {
        LOG.fatal("Error running Client", t);
        System.exit(1);
    }
    if (result) {
        LOG.info("Application completed successfully");
        System.exit(0);
    }
    LOG.error("Application failed to complete successfully");
    System.exit(2);
}

From source file:org.apache.hadoop.yarn.applications.distributedengine.Client.java

/**
 * @param args Command line arguments /*from w  w w.  j a v  a  2  s . c o m*/
 */
public static void main(String[] args) {
    boolean result = false;
    try {
        Client client = new Client();
        if (isVerboseOn) {
            LOG.info("Initializing Client");
        }
        try {
            boolean doRun = client.init(args);
            if (!doRun) {
                System.exit(0);
            }
        } catch (IllegalArgumentException e) {
            System.err.println(e.getLocalizedMessage());
            client.printUsage();
            System.exit(-1);
        }
        result = client.run();
    } catch (Throwable t) {
        LOG.fatal("Error running CLient", t);
        System.exit(1);
    }
    if (result) {
        LOG.info("Application completed successfully");
        System.exit(0);
    }
    LOG.error("Application failed to complete successfully");
    System.exit(2);
}