// TODO: This could probably be more descriptive.
throw new CommandFailedException("The config location is invalid", e);
case CANNOT_WRITE:
throw new CommandFailedException("Cannot write to the config", e);
case SECTION_OR_NAME_NOT_PROVIDED:
throw new InvalidParameterException("No section or name was provided", e);
case SECTION_OR_KEY_INVALID:
throw new InvalidParameterException("The section or key is invalid", e);
case OPTION_DOES_NOT_EXIST:
throw new InvalidParameterException("Tried to unset an option that does not exist",
e);
case MULTIPLE_OPTIONS_MATCH:
throw new InvalidParameterException(
"Tried to unset/set an option for which multiple lines match", e);
case INVALID_REGEXP:
throw new InvalidParameterException("Tried to use an invalid regexp", e);
case USERHOME_NOT_SET:
throw new InvalidParameterException(
"Used --global option without $HOME being properly set", e);
case TOO_MANY_ACTIONS:
throw new InvalidParameterException("Tried to use more than one action at a time",
e);
case MISSING_SECTION:
throw new InvalidParameterException(
"Could not find a section with the name provided", e);
case TOO_MANY_ARGS:
throw new InvalidParameterException("Too many arguments provided.", e);
}
} finally {
if (closeIt) {
geogig.close();
}