|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
org.labkey.remoteapi.CommandException
public class CommandException
Represents an exception that occurs while executing a command.
An instance of this class is typically thrown when the server returns
a non-success HTTP status code (>= 400). The developer may catch
this exception type and use the getStatusCode() method
to retrieve the particular HTTP status code.
If the server generated an exception and sent details back to the
client, the exception message will be set as the message text, which
is returned from the toString() method. Other properties
about the exception, such as the exception class and stack trace, may
be obtained via the getProperties() method.
| Constructor Summary | |
|---|---|
CommandException(java.lang.String message)
Constructs a new CommandException given a message only. |
|
CommandException(java.lang.String message,
int statusCode,
java.util.Map<java.lang.String,java.lang.Object> properties,
java.lang.String responseText)
Constructs a new CommandException given a message, HTTP status code, and exception property map (which may be null). |
|
| Method Summary | |
|---|---|
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Returns the exception property map, or null if no map was set. |
java.lang.String |
getResponseText()
Returns the text of the response |
int |
getStatusCode()
Returns the HTTP status code returned by the server. |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CommandException(java.lang.String message)
message - The message text (should not be null).
public CommandException(java.lang.String message,
int statusCode,
java.util.Map<java.lang.String,java.lang.Object> properties,
java.lang.String responseText)
message - The message text (should not be null).statusCode - The HTTP status code.properties - The exception property map (may be null)responseText - The full response text (may be null)| Method Detail |
|---|
public int getStatusCode()
public java.lang.String getResponseText()
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||