|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
com.google.gdata.util.ServiceException
public class ServiceException
The ServiceException class is the base exception class used to indicate an error while processing a GDataRequest.
Nested Class Summary | |
---|---|
static class |
ServiceException.LocationType
Enumerated constants for error location types. |
Constructor Summary | |
---|---|
ServiceException(ErrorDomain.ErrorCode errorCode)
Initializes the ServiceException using an ErrorCode
object that encapsulates most of the information about the
error. |
|
ServiceException(ErrorDomain.ErrorCode errorCode,
java.lang.Throwable cause)
Initializes the ServiceException using an ErrorCode object
that encapsulates most of the information about the error, and
an embedded exception. |
|
ServiceException(java.net.HttpURLConnection httpConn)
Initializes the ServiceException using the error response data from an HTTP connection. |
|
ServiceException(java.lang.String message)
|
|
ServiceException(java.lang.String message,
java.lang.Throwable cause)
|
|
ServiceException(java.lang.Throwable cause)
|
Method Summary | |
---|---|
ServiceException |
addSibling(ServiceException newbie)
Make and siblings, returning . |
java.lang.String |
getCodeName()
Return error code. |
java.lang.String |
getDebugInfo()
Return debugging information. |
java.lang.String |
getDomainName()
Return error domain. |
java.lang.String |
getExtendedHelp()
Return URI for extended help No default. |
int |
getHttpErrorCodeOverride()
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getHttpHeaders()
Return the internal HTTP headers in modifiable form. |
java.lang.String |
getInternalReason()
Return error internal reason. |
java.lang.String |
getLocation()
Return error location. |
ServiceException.LocationType |
getLocationType()
|
java.lang.String |
getMessage()
Return message: same as getInternalReason. |
java.lang.String |
getResponseBody()
|
ContentType |
getResponseContentType()
|
java.lang.String |
getSendReport()
Return URI to send report to. |
java.util.List<ServiceException> |
getSiblings()
Return an unmodifiable copy of the sibling list. |
boolean |
matches(ErrorDomain.ErrorCode errorCode)
Return true if this ServiceException matches the specified ErrorDomain.ErrorCode in domain name and code name. |
boolean |
matchesAny(ErrorDomain.ErrorCode errorCode)
Return true if this ServiceException or any of its sibling exceptions matches the specified ErrorDomain.ErrorCode in domain name and code name. |
void |
setCode(java.lang.String code)
Set error code. |
void |
setDebugInfo(java.lang.String debugInfo)
Set debugging information. |
void |
setDomain(java.lang.String domain)
Set error domain. |
void |
setExtendedHelp(java.lang.String extendedHelp)
Set URI for extended help. |
void |
setHeaderLocation(java.lang.String location)
Set header name for an error in a header. |
void |
setHttpErrorCodeOverride(int v)
|
void |
setInternalReason(java.lang.String internalReason)
Set error internal reason. |
void |
setLocation(java.lang.String location)
Set generic error location. |
void |
setResponse(ContentType contentType,
java.lang.String body)
Set HTTP response type and body simultaneously. |
void |
setResponseBody(java.lang.String body)
|
void |
setResponseContentType(ContentType v)
|
void |
setSendReport(java.lang.String sendReport)
Set URI to send report to. |
void |
setXpathLocation(java.lang.String location)
Set XPath-based error location. |
java.lang.String |
toString()
|
java.lang.String |
toXmlErrorMessage()
Generate error message in XML format. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ServiceException(java.lang.String message)
public ServiceException(java.lang.String message, java.lang.Throwable cause)
public ServiceException(java.lang.Throwable cause)
public ServiceException(java.net.HttpURLConnection httpConn) throws java.io.IOException
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
java.io.IOException
- if network error receiving the error responsepublic ServiceException(ErrorDomain.ErrorCode errorCode)
ErrorCode
object that encapsulates most of the information about the
error. ErrorCodes are declared in a subclass of
ErrorDomain
containing all the errors for this
GData domain (service or portion of service).
public ServiceException(ErrorDomain.ErrorCode errorCode, java.lang.Throwable cause)
ErrorCode
object
that encapsulates most of the information about the error, and
an embedded exception. ErrorCodes are declared in a subclass of
ErrorDomain
containing all the errors for this GData domain
(service or portion of service).
Method Detail |
---|
public int getHttpErrorCodeOverride()
public void setHttpErrorCodeOverride(int v)
public ContentType getResponseContentType()
public void setResponseContentType(ContentType v)
public java.lang.String getResponseBody()
public void setResponseBody(java.lang.String body)
public void setResponse(ContentType contentType, java.lang.String body)
public java.lang.String toXmlErrorMessage()
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHttpHeaders()
public java.lang.String toString()
toString
in class java.lang.Throwable
public java.lang.String getDomainName()
public void setDomain(java.lang.String domain)
public java.lang.String getCodeName()
public void setCode(java.lang.String code)
public java.lang.String getLocation()
public ServiceException.LocationType getLocationType()
public void setXpathLocation(java.lang.String location)
public void setHeaderLocation(java.lang.String location)
public void setLocation(java.lang.String location)
public java.lang.String getInternalReason()
public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
public void setInternalReason(java.lang.String internalReason)
public java.lang.String getExtendedHelp()
public void setExtendedHelp(java.lang.String extendedHelp)
public java.lang.String getSendReport()
public void setSendReport(java.lang.String sendReport)
public java.lang.String getDebugInfo()
public void setDebugInfo(java.lang.String debugInfo)
public java.util.List<ServiceException> getSiblings()
public ServiceException addSibling(ServiceException newbie)
public boolean matches(ErrorDomain.ErrorCode errorCode)
ErrorDomain.ErrorCode
in domain name and code name.
Sibling exceptions are not checked.
public boolean matchesAny(ErrorDomain.ErrorCode errorCode)
ErrorDomain.ErrorCode
in domain name and code name.
If you want to know which particular ServiceException
matched, call getSiblings()
and examine the
individual ServiceExceptions with #match
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |