Skip to content

Commit

Permalink
add graceful error for io.airlift.airline.ParseArgumentsUnexpectedExc…
Browse files Browse the repository at this point in the history
…eption (OpenAPITools#494)
  • Loading branch information
grokify authored and wing328 committed Jul 8, 2018
1 parent 38b4d17 commit a0f5f5d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import io.airlift.airline.Cli;
import io.airlift.airline.Help;
import io.airlift.airline.ParseArgumentsUnexpectedException;
import io.airlift.airline.ParseOptionMissingException;
import io.airlift.airline.ParseOptionMissingValueException;
import org.openapitools.codegen.cmd.*;
Expand Down Expand Up @@ -67,6 +68,9 @@ public static void main(String[] args) {
if (args.length == 0) {
System.exit(1);
}
} catch (ParseArgumentsUnexpectedException e) {
System.err.printf("[error] %s%n%nSee 'openapi-generator-cli help' for usage.%n", e.getMessage());
System.exit(1);
} catch (ParseOptionMissingException | ParseOptionMissingValueException e) {
System.err.printf("[error] %s%n", e.getMessage());
System.exit(1);
Expand Down

0 comments on commit a0f5f5d

Please sign in to comment.