From 12d6061bafc51a29add06065749833b49935537d Mon Sep 17 00:00:00 2001 From: keita Date: Sat, 23 Apr 2022 20:55:51 +0900 Subject: [PATCH] =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=97=E3=81=9Fexception?= =?UTF-8?q?=E3=81=AE=E7=99=BB=E9=8C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cocoatweet/api/interface/httpGet.cc | 8 ++++++++ src/cocoatweet/api/interface/httpPost.cc | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/cocoatweet/api/interface/httpGet.cc b/src/cocoatweet/api/interface/httpGet.cc index d35f1ff..d0e3ed5 100644 --- a/src/cocoatweet/api/interface/httpGet.cc +++ b/src/cocoatweet/api/interface/httpGet.cc @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include "nlohmann/json.hpp" #include #include @@ -136,6 +138,12 @@ void HttpGet::process(std::weak_ptr() == 220) { throw CocoaTweet::Exception::CredentialNotAllowedException( message.get().c_str()); + } else if (error.get() == 99) { + throw CocoaTweet::Exception::CredentialNotVerifiedException( + message.get().c_str()); + } else if (error.get() == 348) { + throw CocoaTweet::Exception::InvalidateTokenException( + message.get().c_str()); } else { } } diff --git a/src/cocoatweet/api/interface/httpPost.cc b/src/cocoatweet/api/interface/httpPost.cc index b3640f2..51c5a3b 100644 --- a/src/cocoatweet/api/interface/httpPost.cc +++ b/src/cocoatweet/api/interface/httpPost.cc @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include "nlohmann/json.hpp" #include #include @@ -153,6 +155,12 @@ void HttpPost::process(std::weak_ptr() == 220) { throw CocoaTweet::Exception::CredentialNotAllowedException( message.get().c_str()); + } else if (error.get() == 99) { + throw CocoaTweet::Exception::CredentialNotVerifiedException( + message.get().c_str()); + } else if (error.get() == 348) { + throw CocoaTweet::Exception::InvalidateTokenException( + message.get().c_str()); } }