追加したexceptionの登録

This commit is contained in:
keita
2022-04-23 20:55:51 +09:00
parent f1c05a5c38
commit 12d6061baf
2 changed files with 16 additions and 0 deletions
+8
View File
@@ -8,6 +8,8 @@
#include <cocoatweet/exception/tokenInvalidException.h>
#include <cocoatweet/exception/missingRequiredParamException.h>
#include <cocoatweet/exception/credentialNotAllowedException.h>
#include <cocoatweet/exception/credentialNotVerifiedException.h>
#include <cocoatweet/exception/invalidateTokenException.h>
#include "nlohmann/json.hpp"
#include <iterator>
#include <memory>
@@ -136,6 +138,12 @@ void HttpGet::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBas
} else if (error.get<int>() == 220) {
throw CocoaTweet::Exception::CredentialNotAllowedException(
message.get<std::string>().c_str());
} else if (error.get<int>() == 99) {
throw CocoaTweet::Exception::CredentialNotVerifiedException(
message.get<std::string>().c_str());
} else if (error.get<int>() == 348) {
throw CocoaTweet::Exception::InvalidateTokenException(
message.get<std::string>().c_str());
} else {
}
}
+8
View File
@@ -8,6 +8,8 @@
#include <cocoatweet/exception/tokenInvalidException.h>
#include <cocoatweet/exception/missingRequiredParamException.h>
#include <cocoatweet/exception/credentialNotAllowedException.h>
#include <cocoatweet/exception/credentialNotVerifiedException.h>
#include <cocoatweet/exception/invalidateTokenException.h>
#include "nlohmann/json.hpp"
#include <iterator>
#include <memory>
@@ -153,6 +155,12 @@ void HttpPost::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBa
} else if (error.get<int>() == 220) {
throw CocoaTweet::Exception::CredentialNotAllowedException(
message.get<std::string>().c_str());
} else if (error.get<int>() == 99) {
throw CocoaTweet::Exception::CredentialNotVerifiedException(
message.get<std::string>().c_str());
} else if (error.get<int>() == 348) {
throw CocoaTweet::Exception::InvalidateTokenException(
message.get<std::string>().c_str());
}
}