Package org.zeroturnaround.exec
Class ProcessInitException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
org.zeroturnaround.exec.ProcessInitException
- All Implemented Interfaces:
Serializable
Creating a process failed providing an error code.
Wraps an IOException
like:
java.io.IOException: Cannot run program "ls": java.io.IOException: error=12, Cannot allocate memory
java.io.IOException: Cannot run program "ls": error=316, Unknown error: 316
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
static ProcessInitException
newInstance
(String prefix, IOException e) Try to wrap a givenIOException
into aProcessInitException
.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
BEFORE_CODE
- See Also:
-
AFTER_CODE
- See Also:
-
NEW_INFIX
- See Also:
-
errorCode
private final int errorCode
-
-
Constructor Details
-
ProcessInitException
-
-
Method Details
-
getErrorCode
public int getErrorCode()- Returns:
- error code raised when a process failed to start.
-
newInstance
Try to wrap a givenIOException
into aProcessInitException
.- Parameters:
prefix
- prefix to be added in the message.e
- existing exception possibly containing an error code in its message.- Returns:
- new exception containing the prefix, error code and its description in the message plus the error code value as a field,
null
if we were unable to find an error code from the original message.
-