Search in sources :

Example 1 with CmdRunException

use of org.opennms.features.jmxconfiggenerator.commands.CmdRunException in project opennms by OpenNMS.

the class Starter method main.

public static void main(String[] args) {
    Starter starter = new Starter();
    CmdLineParser parser = new CmdLineParser(starter, ParserProperties.defaults().withUsageWidth(120));
    try {
        parser.parseArgument(args);
        if (starter.cmd == null) {
            // no command specified, we have to use StarterCommand
            starter.cmd = starter;
        }
        starter.cmd.run(parser);
    } catch (CmdLineException e) {
        starter.LOG.error(e.getMessage());
        starter.LOG.error("");
        starter.cmd.printUsage();
        System.exit(1);
    } catch (CmdRunException ex) {
        handleException(ex, starter.LOG);
        System.exit(2);
    } catch (Exception e) {
        handleException(e, starter.LOG);
        System.exit(3);
    }
}
Also used : CmdLineParser(org.kohsuke.args4j.CmdLineParser) CmdRunException(org.opennms.features.jmxconfiggenerator.commands.CmdRunException) CmdLineException(org.kohsuke.args4j.CmdLineException) CmdLineException(org.kohsuke.args4j.CmdLineException) CmdRunException(org.opennms.features.jmxconfiggenerator.commands.CmdRunException)

Aggregations

CmdLineException (org.kohsuke.args4j.CmdLineException)1 CmdLineParser (org.kohsuke.args4j.CmdLineParser)1 CmdRunException (org.opennms.features.jmxconfiggenerator.commands.CmdRunException)1