Package org.springframework.shell.result
Class ThrowableResultHandler
java.lang.Object
org.springframework.shell.result.TerminalAwareResultHandler<Throwable>
org.springframework.shell.result.ThrowableResultHandler
- All Implemented Interfaces:
ResultHandler<Throwable>
A
ResultHandler
that prints thrown exceptions messages in red.
Stores the last exception reported, so that details can be printed using a
dedicated command if in interactive mode. Prints stacktrace if in
non-interactive mode as dedicated command could not be used.-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The name of the command that may be used to print details about the last error.Fields inherited from class org.springframework.shell.result.TerminalAwareResultHandler
terminal
-
Constructor Summary
ConstructorDescriptionThrowableResultHandler
(org.jline.terminal.Terminal terminal, CommandCatalog commandCatalog, ShellContext shellContext, org.springframework.beans.factory.ObjectProvider<InteractiveShellRunner> interactiveRunner) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doHandleResult
(Throwable result) Return the last error that was dealt with by this result handler.Methods inherited from class org.springframework.shell.result.TerminalAwareResultHandler
handleResult
-
Field Details
-
DETAILS_COMMAND_NAME
The name of the command that may be used to print details about the last error.- See Also:
-
-
Constructor Details
-
ThrowableResultHandler
public ThrowableResultHandler(org.jline.terminal.Terminal terminal, CommandCatalog commandCatalog, ShellContext shellContext, org.springframework.beans.factory.ObjectProvider<InteractiveShellRunner> interactiveRunner)
-
-
Method Details
-
doHandleResult
- Specified by:
doHandleResult
in classTerminalAwareResultHandler<Throwable>
-
getLastError
Return the last error that was dealt with by this result handler.
-