com.google.api.client.http
Class HttpResponseException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.io.IOException
              extended by com.google.api.client.http.HttpResponseException
All Implemented Interfaces:
Serializable

public class HttpResponseException
extends IOException

Exception thrown when an error status code is detected in an HTTP response.

Since:
1.0
Author:
Yaniv Inbar
See Also:
Serialized Form

Constructor Summary
HttpResponseException(HttpResponse response)
          Constructor that uses computeMessage(HttpResponse) for the detail message.
HttpResponseException(HttpResponse response, String message)
          Constructor that allows an alternative detail message to be used.
 
Method Summary
static String computeMessage(HttpResponse response)
          Returns an exception message to use for the given HTTP response.
 HttpResponse getResponse()
          Returns the HTTP response.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpResponseException

public HttpResponseException(HttpResponse response)
Constructor that uses computeMessage(HttpResponse) for the detail message.

Parameters:
response - HTTP response

HttpResponseException

public HttpResponseException(HttpResponse response,
                             String message)
Constructor that allows an alternative detail message to be used.

Parameters:
response - HTTP response
message - detail message to use or null for none
Since:
1.6
Method Detail

getResponse

public final HttpResponse getResponse()
Returns the HTTP response.

Since:
1.5

computeMessage

public static String computeMessage(HttpResponse response)
Returns an exception message to use for the given HTTP response.



Copyright © 2011 Google. All Rights Reserved.