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:
java.io.Serializable
public class ProcessInitException extends java.io.IOExceptionCreating a process failed providing an error code.Wraps an
IOExceptionlike:java.io.IOException: Cannot run program "ls": java.io.IOException: error=12, Cannot allocate memoryjava.io.IOException: Cannot run program "ls": error=316, Unknown error: 316
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringAFTER_CODEprivate static java.lang.StringBEFORE_CODEprivate interrorCodeprivate static java.lang.StringNEW_INFIX
-
Constructor Summary
Constructors Constructor Description ProcessInitException(java.lang.String message, java.lang.Throwable cause, int errorCode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetErrorCode()static ProcessInitExceptionnewInstance(java.lang.String prefix, java.io.IOException e)Try to wrap a givenIOExceptioninto aProcessInitException.
-
-
-
Field Detail
-
BEFORE_CODE
private static final java.lang.String BEFORE_CODE
- See Also:
- Constant Field Values
-
AFTER_CODE
private static final java.lang.String AFTER_CODE
- See Also:
- Constant Field Values
-
NEW_INFIX
private static final java.lang.String NEW_INFIX
- See Also:
- Constant Field Values
-
errorCode
private final int errorCode
-
-
Method Detail
-
getErrorCode
public int getErrorCode()
- Returns:
- error code raised when a process failed to start.
-
newInstance
public static ProcessInitException newInstance(java.lang.String prefix, java.io.IOException e)
Try to wrap a givenIOExceptioninto 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,
nullif we were unable to find an error code from the original message.
-
-