Package liquibase.command
Class CommandFailedException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- liquibase.command.CommandFailedException
-
- All Implemented Interfaces:
Serializable,ExitCodeException
public class CommandFailedException extends Exception implements ExitCodeException
CommandFailedException is thrown any time a command did not succeed. If it did not succeed due to normal and expected reasons, mark it as expected=true. If the CommandFailedException is marked as expected=false, the code calling the command may want to do additional logging or handling of the exception because it knows the command was surprised by the result.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CommandFailedException(CommandResults results, int exitCode, String message, boolean expected)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegergetExitCode()CommandResultsgetResults()booleanisExpected()In certain circumstances, this exception is thrown solely to set the exit code of a command's execution, in which case, the exception is expected.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
CommandFailedException
public CommandFailedException(CommandResults results, int exitCode, String message, boolean expected)
-
-
Method Detail
-
getResults
public CommandResults getResults()
-
getExitCode
public Integer getExitCode()
- Specified by:
getExitCodein interfaceExitCodeException
-
isExpected
public boolean isExpected()
In certain circumstances, this exception is thrown solely to set the exit code of a command's execution, in which case, the exception is expected. In these cases, Liquibase does not print the stacktrace of the exception to the logs, and isExpected returns true.
-
-