Class ProcessInitException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
org.zeroturnaround.exec.ProcessInitException
All Implemented Interfaces:
Serializable

public class ProcessInitException extends IOException
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 Details

  • Constructor Details

    • ProcessInitException

      public ProcessInitException(String message, Throwable cause, int errorCode)
  • Method Details

    • getErrorCode

      public int getErrorCode()
      Returns:
      error code raised when a process failed to start.
    • newInstance

      public static ProcessInitException newInstance(String prefix, IOException e)
      Try to wrap a given IOException into a ProcessInitException.
      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.