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
ShellCommand
s.
Causes include missing executables as well as failed commands.- Author:
- Alexander Schultheiß
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionConstructs aShellException
on command failures indicated by an exception.ShellException
(List<String> output) Constructs aShellException
on 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 aShellException
on command failures indicated by an exception. -
ShellException
Constructs aShellException
on command failures indicated by an exit code. If possible bothstdout
andstderr
should be provided inoutput
.
-
-
Method Details
-
getOutput
Returns the output (stdout
andstderr
) of the failed command. -
convert
Merge lines into a single string. UsesSystem.lineSeparator
for 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
String
containing all lines ofoutput
-