Class ShellException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.variantsync.diffdetective.shell.ShellException
- All Implemented Interfaces:
Serializable
Thrown on execution errors of
ShellCommands.
Causes include missing executables as well as failed commands.- Author:
- Alexander Schultheiß
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs aShellExceptionon command failures indicated by an exception.ShellException(List<String> output) Constructs aShellExceptionon command failures indicated by an exit code. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
output
-
-
Constructor Details
-
ShellException
Constructs aShellExceptionon command failures indicated by an exception. -
ShellException
Constructs aShellExceptionon command failures indicated by an exit code. If possible bothstdoutandstderrshould be provided inoutput.
-
-
Method Details
-
getOutput
Returns the output (stdoutandstderr) of the failed command. -
convert
Merge lines into a single string. UsesSystem.lineSeparatorfor separating the lines. A final new line is added only if at least one line is given.- Parameters:
output- lines to be merged- Returns:
- a single
Stringcontaining all lines ofoutput
-