|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.social.twitter.TwitterResponseStatusCodeTranslator
public class TwitterResponseStatusCodeTranslator
Implementation of ResponseStatusCodeTranslator
that reads a Twitter
error response and translates it into a specific subclass of
SocialException
.
Per http://apiwiki.twitter.com/HTTP-Response-Codes-and-Errors, when Twitter
responds with an error, the response will be a hash with two entries: request
and error. These entries, along with the HTTP status code, can be used to
determine the nature of an error and enable TwitterTemplate
to throw
a meaningful exception.
Constructor Summary | |
---|---|
TwitterResponseStatusCodeTranslator()
|
Method Summary | |
---|---|
SocialException |
translate(ResponseEntity<?> responseEntity)
Translate responseEntity into a SocialException |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TwitterResponseStatusCodeTranslator()
Method Detail |
---|
public SocialException translate(ResponseEntity<?> responseEntity)
ResponseStatusCodeTranslator
translate
in interface ResponseStatusCodeTranslator
responseEntity
- The response from the social network provider
null
if the response doesn't translate into an error.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |