Package net.algart.arrays
Class ExternalProcessException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
net.algart.arrays.ExternalProcessException
- All Implemented Interfaces:
Serializable
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 Summary
ConstructorDescriptionExternalProcessException
(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. -
Method Summary
Modifier and TypeMethodDescriptionReturns the summary error message of the external process, the execution of which led to throwing this exception.int
Returns the exit code of the external process, the execution of which led to throwing this exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
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 ofExternalProcessor.execute(ProcessBuilder)
method.It is the first argument of the constructor.
- Returns:
- the exit code of the external process
-
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.
-