From 5cebef5d9c3251007ae979cd32c35376c1336f9c Mon Sep 17 00:00:00 2001 From: keita Date: Tue, 23 Feb 2021 11:53:32 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=A1=E3=82=B8=E3=83=A3=E3=83=BC=E3=81=A9?= =?UTF-8?q?=E3=81=93=E3=81=AA=E4=BE=8B=E5=A4=96=E3=82=AF=E3=83=A9=E3=82=B9?= =?UTF-8?q?=E3=81=AE=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exception/authenticateException.h | 12 ++++++++++++ src/cocoatweet/exception/exception.h | 18 ++++++++++++++++++ src/cocoatweet/exception/rateLimitException.h | 12 ++++++++++++ .../exception/tweetDuplicateException.h | 12 ++++++++++++ .../exception/tweetNotFoundException.h | 12 ++++++++++++ .../exception/tweetTooLongException.h | 12 ++++++++++++ 6 files changed, 78 insertions(+) create mode 100644 src/cocoatweet/exception/authenticateException.h create mode 100644 src/cocoatweet/exception/exception.h create mode 100644 src/cocoatweet/exception/rateLimitException.h create mode 100644 src/cocoatweet/exception/tweetDuplicateException.h create mode 100644 src/cocoatweet/exception/tweetNotFoundException.h create mode 100644 src/cocoatweet/exception/tweetTooLongException.h diff --git a/src/cocoatweet/exception/authenticateException.h b/src/cocoatweet/exception/authenticateException.h new file mode 100644 index 0000000..ecf4027 --- /dev/null +++ b/src/cocoatweet/exception/authenticateException.h @@ -0,0 +1,12 @@ +#ifndef COCOATWEET_EXCEPTION_AUTHENTICATEEXCEPTION_H_ +#define COCOATWEET_EXCEPTION_AUTHENTICATEEXCEPTION_H_ + +#include + +namespace CocoaTweet::Exception{ + class AuthenticateException final: Exception{ + using Exception::Exception; + }; +} + +#endif diff --git a/src/cocoatweet/exception/exception.h b/src/cocoatweet/exception/exception.h new file mode 100644 index 0000000..3e2572f --- /dev/null +++ b/src/cocoatweet/exception/exception.h @@ -0,0 +1,18 @@ +#ifndef COCOATWEET_EXCEPTION_EXCEPTION_H_ +#define COCOATWEET_EXCEPTION_EXCEPTION_H_ + +#include +#include + +namespace CocoaTweet::Exception{ +class Exception: public std::exception{ + public: + Exception(const char* _msg):msg_(std::string(_msg)){} + const std::string& what(){return msg_;} + virtual ~Exception() = default; + protected: + std::string msg_; +}; +} + +#endif diff --git a/src/cocoatweet/exception/rateLimitException.h b/src/cocoatweet/exception/rateLimitException.h new file mode 100644 index 0000000..3457347 --- /dev/null +++ b/src/cocoatweet/exception/rateLimitException.h @@ -0,0 +1,12 @@ +#ifndef COCOATWEET_EXCEPTION_RATELIMITEXCEPTION_H_ +#define COCOATWEET_EXCEPTION_RATELIMITEXCEPTION_H_ + +#include + +namespace CocoaTweet::Exception{ + class RateLimitException final: Exception{ + using Exception::Exception; + }; +} + +#endif diff --git a/src/cocoatweet/exception/tweetDuplicateException.h b/src/cocoatweet/exception/tweetDuplicateException.h new file mode 100644 index 0000000..385f82c --- /dev/null +++ b/src/cocoatweet/exception/tweetDuplicateException.h @@ -0,0 +1,12 @@ +#ifndef COCOATWEET_EXCEPTION_TWEETDUPLICATEEXCEPTION_H_ +#define COCOATWEET_EXCEPTION_TWEETDUPLICATEEXCEPTION_H_ + +#include + +namespace CocoaTweet::Exception{ + class TweetDuplicateException final: Exception{ + using Exception::Exception; + }; +} + +#endif diff --git a/src/cocoatweet/exception/tweetNotFoundException.h b/src/cocoatweet/exception/tweetNotFoundException.h new file mode 100644 index 0000000..05fd98d --- /dev/null +++ b/src/cocoatweet/exception/tweetNotFoundException.h @@ -0,0 +1,12 @@ +#ifndef COCOATWEET_EXCEPTION_TWEETNOTFOUNDEXCEPTION_H_ +#define COCOATWEET_EXCEPTION_TWEETNOTFOUNDEXCEPTION_H_ + +#include + +namespace CocoaTweet::Exception{ + class TweetNotFoundException final: Exception{ + using Exception::Exception; + }; +} + +#endif diff --git a/src/cocoatweet/exception/tweetTooLongException.h b/src/cocoatweet/exception/tweetTooLongException.h new file mode 100644 index 0000000..2aaed1f --- /dev/null +++ b/src/cocoatweet/exception/tweetTooLongException.h @@ -0,0 +1,12 @@ +#ifndef COCOATWEET_EXCEPTION_TWEETTOOLONGEXCEPTION_H_ +#define COCOATWEET_EXCEPTION_TWEETTOOLONGEXCEPTION_H_ + +#include + +namespace CocoaTweet::Exception{ + class TweetTooLongException final: Exception{ + using Exception::Exception; + }; +} + +#endif