Class AbortedByHookException

  • All Implemented Interfaces:
    java.io.Serializable

    public class AbortedByHookException
    extends GitAPIException
    Exception thrown when a hook returns a process result with a value different from 0. It is up to the caller to decide whether this should block execution or not.
    Since:
    4.0
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String hookName
      The hook that caused this exception.
      private java.lang.String hookStdErr
      The stderr output of the hook.
      private int returnCode
      The process result.
      private static long serialVersionUID  
    • Constructor Summary

      Constructors 
      Constructor Description
      AbortedByHookException​(java.lang.String hookStdErr, java.lang.String hookName, int returnCode)
      Constructor for AbortedByHookException
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getHookName()
      Get hook name
      java.lang.String getHookStdErr()
      Get the stderr output of the hook.
      int getReturnCode()
      Get return code
      • 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
    • Field Detail

      • hookName

        private final java.lang.String hookName
        The hook that caused this exception.
      • returnCode

        private final int returnCode
        The process result.
      • hookStdErr

        private final java.lang.String hookStdErr
        The stderr output of the hook.
    • Constructor Detail

      • AbortedByHookException

        public AbortedByHookException​(java.lang.String hookStdErr,
                                      java.lang.String hookName,
                                      int returnCode)
        Constructor for AbortedByHookException
        Parameters:
        hookStdErr - The error details from the stderr output of the hook
        hookName - The name of the hook that interrupted the command, must not be null.
        returnCode - The return code of the hook process that has been run.
    • Method Detail

      • getHookName

        public java.lang.String getHookName()
        Get hook name
        Returns:
        the type of the hook that interrupted the git command.
      • getReturnCode

        public int getReturnCode()
        Get return code
        Returns:
        the hook process result.
      • getHookStdErr

        public java.lang.String getHookStdErr()
        Get the stderr output of the hook.
        Returns:
        A string containing the complete stderr output of the hook.
        Since:
        5.6