Merge "AsciiDoctor, DocIndexer: Don't use deprecated CmdLineException"

This commit is contained in:
Edwin Kempin
2018-08-07 06:51:41 +00:00
committed by Gerrit Code Review
2 changed files with 4 additions and 4 deletions

View File

@@ -142,9 +142,9 @@ public class AsciiDoctor {
try {
parser.parseArgument(parameters);
if (inputFiles.isEmpty()) {
throw new CmdLineException(parser, "asciidoctor: FAILED: input file missing");
throw new IllegalArgumentException("asciidoctor: FAILED: input file missing");
}
} catch (CmdLineException e) {
} catch (CmdLineException | IllegalArgumentException e) {
System.err.println(e.getMessage());
parser.printUsage(System.err);
System.exit(1);

View File

@@ -72,9 +72,9 @@ public class DocIndexer {
try {
parser.parseArgument(parameters);
if (inputFiles.isEmpty()) {
throw new CmdLineException(parser, "FAILED: input file missing");
throw new IllegalArgumentException("FAILED: input file missing");
}
} catch (CmdLineException e) {
} catch (CmdLineException | IllegalArgumentException e) {
System.err.println(e.getMessage());
parser.printUsage(System.err);
System.exit(1);