This commit is contained in:
keita
2021-02-25 18:20:16 +09:00
parent f27fe13c41
commit b28bead5c8
7 changed files with 15 additions and 12 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
#ifndef COCOATWEET_API_H_ #ifndef COCOATWEET_API_API_H_
#define COCOATWEET_API_H_ #define COCOATWEET_API_API_H_
#include <cocoatweet/api/status/status.h> #include <cocoatweet/api/status/status.h>
#include <cocoatweet/api/favorite/favorite.h> #include <cocoatweet/api/favorite/favorite.h>
@@ -1,5 +1,5 @@
#ifndef COCOATWEET_API_GROUPINTERFACE_H_ #ifndef COCOATWEET_API_INTERFACE_GROUPINTERFACE_H_
#define COCOATWEET_API_GROUPINTERFACE_H_ #define COCOATWEET_API_INTERFACE_GROUPINTERFACE_H_
#include <memory> #include <memory>
#include "cocoatweet/oauth/oauth.h" #include "cocoatweet/oauth/oauth.h"
+2 -2
View File
@@ -1,5 +1,5 @@
#ifndef COCOATWEET_API_INTERFACE_POSTINTERFACE_H_ #ifndef COCOATWEET_API_INTERFACE_HTTPPOST_H_
#define COCOATWEET_API_INTERFACE_POSTINTERFACE_H_ #define COCOATWEET_API_INTERFACE_HTTPPOST_H_
#include <functional> #include <functional>
#include "cocoatweet/oauth/oauth.h" #include "cocoatweet/oauth/oauth.h"
+3
View File
@@ -1,5 +1,6 @@
#include <cocoatweet/api/model/tweet.h> #include <cocoatweet/api/model/tweet.h>
#include <cocoatweet/exception/tweetNotFoundException.h> #include <cocoatweet/exception/tweetNotFoundException.h>
#include <cocoatweet/exception/authenticateException.h>
#include "nlohmann/json.hpp" #include "nlohmann/json.hpp"
#include <iostream> #include <iostream>
@@ -16,6 +17,8 @@ Tweet Tweet::parse(const unsigned int _responseCode, const std::string& _json) {
auto message = j["errors"][0]["message"]; auto message = j["errors"][0]["message"];
if (error.get<int>() == 144) { if (error.get<int>() == 144) {
throw CocoaTweet::Exception::TweetNotFoundException(message.get<std::string>().c_str()); throw CocoaTweet::Exception::TweetNotFoundException(message.get<std::string>().c_str());
}else if(errot.get<int>() == 32){
throw CocoaTweet::Exception::AuthenticateFoundException(message.get<std::string>().c_str());
} }
} }
+2 -2
View File
@@ -1,5 +1,5 @@
#ifndef COCOATWEET_API_STATUSES_DESTROY_H_ #ifndef COCOATWEET_API_STATUS_DESTROY_H_
#define COCOATWEET_API_STATUSES_DESTROY_H_ #define COCOATWEET_API_STATUS_DESTROY_H_
#include <memory> #include <memory>
#include <cocoatweet/api/interface/httpPost.h> #include <cocoatweet/api/interface/httpPost.h>
+2 -2
View File
@@ -1,5 +1,5 @@
#ifndef COCOATWEET_API_STATUSED_H_ #ifndef COCOATWEET_API_STATUS_STATUS_H_
#define COCOATWEET_API_STATUSED_H_ #define COCOATWEET_API_STATUS_STATUS_H_
#include "cocoatweet/api/interface/groupInterface.h" #include "cocoatweet/api/interface/groupInterface.h"
#include "cocoatweet/oauth/oauth.h" #include "cocoatweet/oauth/oauth.h"
+2 -2
View File
@@ -1,5 +1,5 @@
#ifndef COCOATWEET_API_STATUSES_UPDATE_H_ #ifndef COCOATWEET_API_STATUS_UPDATE_H_
#define COCOATWEET_API_STATUSES_UPDATE_H_ #define COCOATWEET_API_STATUS_UPDATE_H_
#include <memory> #include <memory>
#include <cocoatweet/api/interface/httpPost.h> #include <cocoatweet/api/interface/httpPost.h>