Package org.eclipse.jgit.api.errors
Class AbortedByHookException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.AbortedByHookException
- All Implemented Interfaces:
Serializable
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:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbortedByHookException
(String hookStdErr, String hookName, int returnCode) Constructor for AbortedByHookException -
Method Summary
Modifier and TypeMethodDescriptionGet hook nameGet the stderr output of the hook.int
Get return codeMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
hookName
The hook that caused this exception. -
returnCode
private final int returnCodeThe process result. -
hookStdErr
The stderr output of the hook.
-
-
Constructor Details
-
AbortedByHookException
Constructor for AbortedByHookException- Parameters:
hookStdErr
- The error details from the stderr output of the hookhookName
- 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 Details
-
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
Get the stderr output of the hook.- Returns:
- A string containing the complete stderr output of the hook.
- Since:
- 5.6
-