Top Description Fields Constructors Methods
liquibase.command

public Class CommandFailedException

extends Exception
Class Inheritance

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.

Field Summary

Modifier and TypeField and Description
private final int
private final boolean
private final CommandResults
private static final long

Constructor Summary

AccessConstructor and Description
public
CommandFailedException(CommandResults results, int exitCode, String message, boolean expected)

Method Summary

Modifier and TypeMethod and Description
public int
public CommandResults
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.

Field Detail

exitCodeback to summary
private final int exitCode
expectedback to summary
private final boolean expected
resultsback to summary
private final CommandResults results
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.Exception.serialVersionUID.

Constructor Detail

CommandFailedExceptionback to summary
public CommandFailedException(CommandResults results, int exitCode, String message, boolean expected)

Method Detail

getExitCodeback to summary
public int getExitCode()
getResultsback to summary
public CommandResults getResults()
isExpectedback to summary
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.