Class ShellException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.variantsync.diffdetective.shell.ShellException
All Implemented Interfaces:
Serializable

public class ShellException extends Exception
Thrown on execution errors of ShellCommands. Causes include missing executables as well as failed commands.
Author:
Alexander Schultheiß
See Also:
  • Field Details

  • Constructor Details

    • ShellException

      public ShellException(Exception e)
      Constructs a ShellException on command failures indicated by an exception.
    • ShellException

      public ShellException(List<String> output)
      Constructs a ShellException on command failures indicated by an exit code. If possible both stdout and stderr should be provided in output.
  • Method Details

    • getOutput

      public List<String> getOutput()
      Returns the output (stdout and stderr) of the failed command.
    • convert

      private static String convert(Collection<String> output)
      Merge lines into a single string. Uses System.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 of output