Skip to content

Commit dab46ff

Browse files
author
rathnapandi
committed
- avoid printing exception for help command
1 parent 98989c1 commit dab46ff

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

modules/apim-adapter/src/main/java/com/axway/apim/lib/CLIOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public void parse() throws AppException {
8989
this.envProperties = new EnvironmentProperties(cmd.getOptionValue("stage"), getValue("apimCLIHome"));
9090
} catch (ParseException e) {
9191
printUsage(e.getMessage(), args);
92-
throw new AppException(e.getMessage(), ErrorCode.UNXPECTED_ERROR, e);
92+
throw new AppException(e.getMessage(), ErrorCode.CLI_PARSING, e);
9393
}
9494
}
9595

modules/apim-adapter/src/main/java/com/axway/apim/lib/error/AppException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public ErrorCode getError() {
4747
}
4848

4949
public void logException(Logger logger) {
50-
if (error == ErrorCode.SUCCESS)
50+
if (error == ErrorCode.SUCCESS || error == ErrorCode.CLI_PARSING)
5151
return;
5252
Throwable cause = null;
5353
if (error.getPrintStackTrace().booleanValue() || logger.isDebugEnabled()) {

modules/apim-adapter/src/main/java/com/axway/apim/lib/error/ErrorCode.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ public enum ErrorCode {
66

77
SUCCESS(0, "Replication of the API was successful.", false, LogLevel.INFO),
88
UNSUPPORTED_API_SPECIFICATION(1, "The API-Specification is not supported by the APIM-CLI.", false),
9+
CLI_PARSING(2, "Error in parsing input parameters", false, LogLevel.INFO),
10+
911
MISSING_PARAMETER(5, "There is a missing parameter.", false),
1012
INVALID_PARAMETER(6, "There is an invalid parameter.", false),
1113
API_ALREADY_EXISTS(7, "The API already exists for another organization.", false),

0 commit comments

Comments
 (0)