MCPcopy
hub / github.com/remkop/picocli / mappedExitCode

Method mappedExitCode

src/main/java/picocli/CommandLine.java:1237–1244  ·  view source on GitHub ↗
(Throwable t, IExitCodeExceptionMapper mapper, int defaultExitCode)

Source from the content-addressed store, hash-verified

1235 int getExitCode(Throwable exception);
1236 }
1237 private static int mappedExitCode(Throwable t, IExitCodeExceptionMapper mapper, int defaultExitCode) {
1238 try {
1239 return (mapper != null) ? mapper.getExitCode(t) : defaultExitCode;
1240 } catch (Exception ex) {
1241 ex.printStackTrace();
1242 return defaultExitCode;
1243 }
1244 }
1245
1246 /** Returns the color scheme to use when printing help.
1247 * The default value is the {@linkplain picocli.CommandLine.Help#defaultColorScheme(CommandLine.Help.Ansi) default color scheme} with {@link Help.Ansi#AUTO Ansi.AUTO}.

Callers 2

handleParseExceptionMethod · 0.95
handleUnhandledMethod · 0.95

Calls 1

getExitCodeMethod · 0.65

Tested by

no test coverage detected