| java.lang.Object | |||
| ↳ | java.lang.Throwable | ||
| ↳ | java.lang.Exception | ||
| ↳ | com.google.gdata.util.ServiceException | ||
The ServiceException class is the base exception class used to indicate an error while processing a GDataRequest.
|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Exception
| |||||||||||
From class
java.lang.Throwable
| |||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| errorElement | |||||||||||
| httpErrorCodeOverride | HTTP error code. | ||||||||||
| httpHeaders | Optional HTTP headers to be output when HTTP response is generated. | ||||||||||
| responseBody | Retrieve HTTP response body or error message. | ||||||||||
| responseContentType | Optional HTTP content type for a response. | ||||||||||
| siblings | Set to the exception we are filling during parsing. | ||||||||||
|
[Expand]
Inherited Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Throwable
| |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Initializes the ServiceException using the error response data from an
HTTP connection.
| |||||||||||
Initializes the ServiceException using an
ErrorContent object that
encapsulates most of the information about the error. | |||||||||||
Initializes the ServiceException using an
ErrorContent object that
encapsulates most of the information about the error, and an embedded
exception. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Make {@tt this} and {@tt newbie} siblings, returning {@tt this}.
| |||||||||||
Return error code.
| |||||||||||
Return debugging information.
| |||||||||||
Return error domain.
| |||||||||||
Return URI for extended help
| |||||||||||
Return the value for requested internal HTTP header or
null if
the header is not present. | |||||||||||
Return the internal HTTP headers in modifiable form.
| |||||||||||
Return error internal reason.
| |||||||||||
Return error location.
| |||||||||||
Return error location type.
| |||||||||||
Return message: same as getInternalReason.
| |||||||||||
Returns the headers related to the OAuth Proxy.
| |||||||||||
Return URI to send report to.
| |||||||||||
Return an unmodifiable copy of the sibling list.
| |||||||||||
Returns whether or not the request has OAuth Proxy-related headers.
| |||||||||||
If | |||||||||||
Return true if this ServiceException matches the specified
ErrorContent in domain name and code name. | |||||||||||
Return true if this ServiceException or any of its sibling exceptions
matches the specified
ErrorContent in domain name and code name. | |||||||||||
Set error code.
| |||||||||||
Set debugging information.
| |||||||||||
Set error domain.
| |||||||||||
Set URI for extended help.
| |||||||||||
Set header name for an error in a header.
| |||||||||||
Sets the internal reason of the error.
| |||||||||||
Set generic error location.
| |||||||||||
Set HTTP response type and body simultaneously.
| |||||||||||
Set URI to send report to.
| |||||||||||
Set XPath-based error location.
| |||||||||||
Converts the exception into a well-formated XML error
message suitable for external uses.
| |||||||||||
Converts the exception into a well-formated XML error
message suitable for external uses.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Throwable
| |||||||||||
From class
java.lang.Object
| |||||||||||
HTTP error code.
Optional HTTP headers to be output when HTTP response is generated. It is a mapping from header name to list of header values.
Retrieve HTTP response body or error message. The content type must be set correctly.
| message |
|---|
| message | |
|---|---|
| cause |
| cause |
|---|
Initializes the ServiceException using the error response data from an HTTP connection. This constructor is used in the client library to approximately reconstitute the constructor as it appeared in the server.
This constructor uses a ServiceExceptionInitializer to do the work of parsing the connection and calling our setters to initialize our fields. The initializer object may also create sibling ServiceExceptions.
| httpConn | Is the http connection from which the error message (structured or simple) is read |
|---|
| IOException | if network error receiving the error response |
|---|
Initializes the ServiceException using an ErrorContent object that
encapsulates most of the information about the error. Most ErrorContent
instances are declared in a subclass of ErrorDomain containing all
the errors for a GData domain (service or portion of service).
| errorCode |
|---|
Initializes the ServiceException using an ErrorContent object that
encapsulates most of the information about the error, and an embedded
exception. Most ErrorContent instances are declared in a subclass of
ErrorDomain containing all the errors for this GData domain
(service or portion of service).
| errorCode | |
|---|---|
| cause |
Make {@tt this} and {@tt newbie} siblings, returning {@tt this}. All sibling exceptions are jointly converted to an error message when any of them are thrown.
| newbie |
|---|
Return error code.
Defaults to the class name of this.
Return debugging information. Defaults to the stack trace.
Return error domain.
Defaults to "GData", indicating an error that has not yet been upgraded to the new architecture.
Return URI for extended help
Return the value for requested internal HTTP header or null if
the header is not present.
| header | Requested header name |
|---|
null if
requested header is not found.
Return the internal HTTP headers in modifiable form.
Return error internal reason.
Defaults to the message set at construction time.
Return error location.
Return message: same as getInternalReason.
Returns the headers related to the OAuth Proxy. If there are no OAuth
Proxy related headers on the request, this method will return an
OAuthProxyResponse object with null values for the headers. Use
hasOAuthProxyResponse() to determine whether the request has
OAuth Proxy information.
Return URI to send report to.
Returns whether or not the request has OAuth Proxy-related headers.
If cause is a ServiceException, it is added to
the list of siblings so that the original exception appears when
using XML error output.
| cause |
|---|
Return true if this ServiceException matches the specified
ErrorContent in domain name and code name. Sibling exceptions are
not checked.
| code |
|---|
Return true if this ServiceException or any of its sibling exceptions
matches the specified ErrorContent in domain name and code name.
If you want to know which particular ServiceException matched, call
getSiblings() and examine the individual ServiceExceptions with
matches(ErrorContent).
| errorCode |
|---|
Set error code.
| code |
|---|
| NullPointerException | if code is null.
|
|---|
Set debugging information.
| debugInfo |
|---|
| NullPointerException | if debugInfo is null.
|
|---|
Set error domain.
| domain |
|---|
| NullPointerException | if domain is null.
|
|---|
Set URI for extended help.
| extendedHelp |
|---|
| NullPointerException | if extendedHelp is null.
|
|---|
Set header name for an error in a header.
| location |
|---|
| NullPointerException | if location is null.
|
|---|
| v |
|---|
Sets the internal reason of the error.
| internalReason |
|---|
| NullPointerException | if internalReason is null.
|
|---|
Set generic error location.
| location |
|---|
| NullPointerException | if location is null.
|
|---|
Set HTTP response type and body simultaneously. They are inherently coupled together: a body without a content type is meaningless; a content type without a body is useless.
| contentType | |
|---|---|
| body |
| body |
|---|
Set URI to send report to.
| sendReport |
|---|
| NullPointerException | if sendReport is null.
|
|---|
Set XPath-based error location. This must be a valid XPath expression sibling to the atom:entry element (or the atom:feed element if we are not in an entry).
| location |
|---|
| NullPointerException | if location is null.
|
|---|
Converts the exception into a well-formated XML error message suitable for external uses.
Converts the exception into a well-formated XML error message suitable for external uses.
| includeDebugInfo | If true, include debug information.
Such error message should only be returned to internal clients.
|
|---|