|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.web.client.DefaultResponseErrorHandler org.springframework.social.twitter.TwitterErrorHandler
public class TwitterErrorHandler
Subclass of DefaultResponseErrorHandler
that allows some client and
server exceptions to flow through RestTemplate
as non-errors.
By default, RestTemplate interprets HTTP client (4xx series) errors and
server (5xx series) errors as exceptions and throws an
HttpClientErrorException
. In doing so, this prevents the caller from
retrieving the body of the response.
When Twitter returns an error, it places some extra information about that
error in the body of the response. In order to allow TwitterTemplate
to read that information, those errors need to be treated as non-errors by
RestTemplate. This puts the burden on TwitterTemplate to interpret the error
and act accordingly. But it also enables TwitterTemplate to obtain more
information about the nature of the error.
Constructor Summary | |
---|---|
TwitterErrorHandler()
|
Method Summary | |
---|---|
boolean |
hasError(ClientHttpResponse response)
|
Methods inherited from class org.springframework.web.client.DefaultResponseErrorHandler |
---|
handleError, hasError |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TwitterErrorHandler()
Method Detail |
---|
public boolean hasError(ClientHttpResponse response) throws java.io.IOException
hasError
in interface ResponseErrorHandler
hasError
in class DefaultResponseErrorHandler
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |