Package com.google.gwt.user.client.rpc
Class StatusCodeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.google.gwt.user.client.rpc.InvocationException
com.google.gwt.user.client.rpc.StatusCodeException
- All Implemented Interfaces:
Serializable
Indicates that an RPC response was returned with an invalid HTTP status code.
This exception will be presented via
AsyncCallback.onFailure(Throwable)
if the HTTP response from the
server does not have a 200
status code.- See Also:
-
Constructor Summary
ConstructorDescriptionStatusCodeException
(int statusCode, String encodedResponse) Construct an exception with the given status code and description.StatusCodeException
(int statusCode, String statusText, String encodedResponse) Construct an exception with the given status code, status text and description. -
Method Summary
Modifier and TypeMethodDescriptionReturns the response message associated with the failed request.int
Returns the status code associated with the failed request.Returns the status text associated with the failed request.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
StatusCodeException
Construct an exception with the given status code and description.- Parameters:
statusCode
- the HTTP status code to reportencodedResponse
- the HTTP response message to report
-
StatusCodeException
Construct an exception with the given status code, status text and description.- Parameters:
statusCode
- the HTTP status code to reportstatusText
- the HTTP status text to reportencodedResponse
- the HTTP response message to report
-
-
Method Details
-
getEncodedResponse
Returns the response message associated with the failed request. -
getStatusCode
public int getStatusCode()Returns the status code associated with the failed request.The value will be 0 if the request failed (e.g. network error, or the server disallowed the request) or has been aborted (this will generally be the case when leaving the page).
-
getStatusText
Returns the status text associated with the failed request.
-