Class Overview
A specialization of CommandFailedException
thrown when a command fails because it is called incorrectly.
This exception is an indication of a
developer error, not a
user error. In practice, these exceptions
should never occur during normal operation.
Developer note: When considering the
command
against the
usage
message, be
aware that representing the command as a single
String
may conceal subtle usage issues. For example, when
providing multiple arguments to a
command builder
via its
argument(String)
, providing multiple arguments in a
single call separated by spaces will result in the arguments not being received correctly by the command when it is
executed but will produce the same
String
representation. For example, both of the following will produce the
same
String
:
builder.command("command").argument("a b").build(...).call();
builder.command("command").argument("a").argument("b").build(...).call();
However, the executed command will receive different arguments (
"a b"
and
["a", "b"]
, respectively).
If the command arguments appear to be valid based on the usage message, double-check how they are provided.
Summary
[Expand]
Inherited Methods |
From class
com.atlassian.stash.exception.ServiceException
|
From class
java.lang.Throwable
synchronized
final
void
|
addSuppressed(Throwable arg0)
|
synchronized
Throwable
|
fillInStackTrace()
|
synchronized
Throwable
|
getCause()
|
String
|
getLocalizedMessage()
|
String
|
getMessage()
|
StackTraceElement[]
|
getStackTrace()
|
synchronized
final
Throwable[]
|
getSuppressed()
|
synchronized
Throwable
|
initCause(Throwable arg0)
|
void
|
printStackTrace(PrintStream arg0)
|
void
|
printStackTrace(PrintWriter arg0)
|
void
|
printStackTrace()
|
void
|
setStackTrace(StackTraceElement[] arg0)
|
String
|
toString()
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
Public Constructors
public
CommandUsageException
(KeyedMessage message, String command, String usage)
Public Methods
@Nonnull
public
String
getCommand
()
Returns
- the command as it was executed
@Nonnull
public
String
getUsage
()