org.springframework.web.client
Class HttpStatusCodeException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.springframework.core.NestedRuntimeException
                  extended by org.springframework.web.client.RestClientException
                      extended by org.springframework.web.client.HttpStatusCodeException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HttpClientErrorException, HttpServerErrorException

public abstract class HttpStatusCodeException
extends RestClientException

Abstract base class for exceptions based on an HttpStatus.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Serialized Form

Constructor Summary
protected HttpStatusCodeException(HttpStatus statusCode)
          Construct a new instance of HttpStatusCodeException based on a HttpStatus.
protected HttpStatusCodeException(HttpStatus statusCode, String statusText)
          Construct a new instance of HttpStatusCodeException based on a HttpStatus and status text.
 
Method Summary
 HttpStatus getStatusCode()
          Returns the HTTP status code.
 String getStatusText()
          Returns the HTTP status text.
 
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

HttpStatusCodeException

protected HttpStatusCodeException(HttpStatus statusCode)
Construct a new instance of HttpStatusCodeException based on a HttpStatus.

Parameters:
statusCode - the status code

HttpStatusCodeException

protected HttpStatusCodeException(HttpStatus statusCode,
                                  String statusText)
Construct a new instance of HttpStatusCodeException based on a HttpStatus and status text.

Parameters:
statusCode - the status code
statusText - the status text
Method Detail

getStatusCode

public HttpStatus getStatusCode()
Returns the HTTP status code.


getStatusText

public String getStatusText()
Returns the HTTP status text.