Interface that provides the appropriate exit code that will be returned from the #execute(String...) execute method for an exception that occurred during parsing or while invoking the command's Runnable, Callable, or Method. Example usage: @Command class FailingCommand impl
| 1228 | * @since 4.0 |
| 1229 | */ |
| 1230 | public interface IExitCodeExceptionMapper { |
| 1231 | /** Returns the exit code that should be returned from the {@link #execute(String...) execute} method. |
| 1232 | * @param exception the exception that occurred during parsing or while invoking the command's Runnable, Callable, or Method. |
| 1233 | * @return the exit code |
| 1234 | */ |
| 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; |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…