Google Data APIs Client Library



com.google.gdata.util
Class ServiceException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.google.gdata.util.ServiceException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AppsForYourDomainException, AuthenticationException, BatchInterruptedException, InvalidEntryException, Kind.AdaptorException, NotAcceptableException, NotImplementedException, NotModifiedException, ParseException, PreconditionFailedException, RedirectRequiredException, ResourceNotFoundException, ServiceConfigurationException, ServiceForbiddenException, ServiceUnavailableException, VersionConflictException

public class ServiceException
extends java.lang.Exception

The ServiceException class is the base exception class used to indicate an error while processing a GDataRequest.

See Also:
Serialized Form

Field Summary
protected  int httpErrorCodeOverride
          HTTP error code.
protected  java.lang.String responseBody
          Optional HTTP response body.
protected  ContentType responseContentType
          Optional HTTP content type for a response.
 
Constructor Summary
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
 int getHttpErrorCodeOverride()
           
 java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHttpHeaders()
           
 java.lang.String getResponseBody()
           
 ContentType getResponseContentType()
           
 void setHttpErrorCodeOverride(int v)
           
 void setResponseBody(java.lang.String v)
           
 void setResponseContentType(ContentType v)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

httpErrorCodeOverride

protected int httpErrorCodeOverride
HTTP error code.


responseContentType

protected ContentType responseContentType
Optional HTTP content type for a response.


responseBody

protected java.lang.String responseBody
Optional HTTP response body. Requires the content type to be set.

Constructor Detail

ServiceException

public ServiceException(java.lang.String message)

ServiceException

public ServiceException(java.lang.String message,
                        java.lang.Throwable cause)

ServiceException

public ServiceException(java.lang.Throwable cause)

ServiceException

public ServiceException(java.net.HttpURLConnection httpConn)
                 throws java.io.IOException
Initializes the ServiceException using the error response data from an HTTP connection.

Throws:
java.io.IOException
Method Detail

getHttpErrorCodeOverride

public int getHttpErrorCodeOverride()

setHttpErrorCodeOverride

public void setHttpErrorCodeOverride(int v)

getResponseContentType

public ContentType getResponseContentType()

setResponseContentType

public void setResponseContentType(ContentType v)

getResponseBody

public java.lang.String getResponseBody()

setResponseBody

public void setResponseBody(java.lang.String v)

getHttpHeaders

public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHttpHeaders()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Throwable