Class ProcessInitException

  • All Implemented Interfaces:
    java.io.Serializable

    public class ProcessInitException
    extends java.io.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:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String AFTER_CODE  
      private static java.lang.String BEFORE_CODE  
      private int errorCode  
      private static java.lang.String NEW_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
      int getErrorCode()  
      static ProcessInitException newInstance​(java.lang.String prefix, java.io.IOException e)
      Try to wrap a given IOException into a ProcessInitException.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ProcessInitException

        public ProcessInitException​(java.lang.String message,
                                    java.lang.Throwable cause,
                                    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 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.