public class StatusCodeException extends InvocationException
AsyncCallback.onFailure(Throwable)
if the HTTP response from the
server does not have a 200
status code.Constructor and Description |
---|
StatusCodeException(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.
|
Modifier and Type | Method and Description |
---|---|
String |
getEncodedResponse()
Returns the response message associated with the failed request.
|
int |
getStatusCode()
Returns the status code associated with the failed request.
|
String |
getStatusText()
Returns the status text associated with the failed request.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, setStackTrace, toString
public StatusCodeException(int statusCode, String encodedResponse)
statusCode
- the HTTP status code to reportencodedResponse
- the HTTP response message to reportpublic StatusCodeException(int statusCode, String statusText, String encodedResponse)
statusCode
- the HTTP status code to reportstatusText
- the HTTP status text to reportencodedResponse
- the HTTP response message to reportpublic String getEncodedResponse()
public int getStatusCode()
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).
public String getStatusText()
Copyright © 2016. All rights reserved.