Class ExternalProcessException

All Implemented Interfaces:
Serializable

public class ExternalProcessException extends IOException

Unchecked exception thrown by ExternalProcessor.execute(ProcessBuilder) method, if the called external process is finished with non-zero OS exit code.

Author:
Daniel Alievsky
See Also:
  • Constructor Details

    • ExternalProcessException

      public ExternalProcessException(int externalProcessExitCode, String externalProcessErrorMessage, String message)
      Constructs an instance of this class with the specified exit code, error message of the called program and detail message of this exception.
      Parameters:
      externalProcessExitCode - the exit code of the external process.
      externalProcessErrorMessage - the summary error message: the sequence of lines (separated by String.format("%n")), printed to the error stream of the called external process.
      message - the detail message for this exception (an argument of RuntimeException constructor).
  • Method Details

    • getExternalProcessExitCode

      public int getExternalProcessExitCode()
      Returns the exit code of the external process, the execution of which led to throwing this exception. It is the (non-zero) value, returned by java.lang.Process.waitFor() method at the end of execution of ExternalProcessor.execute(ProcessBuilder) method.

      It is the first argument of the constructor.

      Returns:
      the exit code of the external process
    • getExternalProcessErrorMessage

      public String getExternalProcessErrorMessage()
      Returns the summary error message of the external process, the execution of which led to throwing this exception. It is the sequence of lines (separated by String.format("%n")), printed to the error stream of the called external process.

      It is the second argument of the constructor.

      Returns:
      the summary error message of the external process.