code format
This commit is contained in:
@@ -13,21 +13,21 @@ Tweet Tweet::parse(const unsigned int _responseCode, const std::string& _json) {
|
||||
|
||||
if (_responseCode == 200) {
|
||||
tweet.id(j["id_str"]);
|
||||
tweet.createdAt(j["created_at"]);
|
||||
tweet.text(j["text"]);
|
||||
tweet.source(j["source"]);
|
||||
tweet.createdAt(j["created_at"]);
|
||||
tweet.text(j["text"]);
|
||||
tweet.source(j["source"]);
|
||||
} else {
|
||||
auto error = j["errors"][0]["code"];
|
||||
auto message = j["errors"][0]["message"];
|
||||
if (error.get<int>() == 144) {
|
||||
throw CocoaTweet::Exception::TweetNotFoundException(message.get<std::string>().c_str());
|
||||
}else if(error.get<int>() == 32){
|
||||
} else if (error.get<int>() == 32) {
|
||||
throw CocoaTweet::Exception::AuthenticateException(message.get<std::string>().c_str());
|
||||
}else if(error.get<int>() == 187){
|
||||
} else if (error.get<int>() == 187) {
|
||||
throw CocoaTweet::Exception::TweetDuplicateException(message.get<std::string>().c_str());
|
||||
}else if(error.get<int>() == 88 || error.get<int>() == 185){
|
||||
} else if (error.get<int>() == 88 || error.get<int>() == 185) {
|
||||
throw CocoaTweet::Exception::RateLimitException(message.get<std::string>().c_str());
|
||||
}else if(error.get<int>() == 186){
|
||||
} else if (error.get<int>() == 186) {
|
||||
throw CocoaTweet::Exception::TweetTooLongException(message.get<std::string>().c_str());
|
||||
}
|
||||
}
|
||||
@@ -39,14 +39,14 @@ void Tweet::id(const std::string _id) {
|
||||
id_ = _id;
|
||||
}
|
||||
|
||||
void Tweet::createdAt(const std::string _at){
|
||||
void Tweet::createdAt(const std::string _at) {
|
||||
createdAt_ = _at;
|
||||
}
|
||||
|
||||
void Tweet::text(const std::string _text){
|
||||
void Tweet::text(const std::string _text) {
|
||||
text_ = _text;
|
||||
}
|
||||
void Tweet::source(const std::string _source){
|
||||
void Tweet::source(const std::string _source) {
|
||||
source_ = _source;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user