123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- /*
- * exceptions.h
- *
- * Created on: Mar 20, 2017
- * Author: hp
- */
- #ifndef LIB_MACAROON_EXCEPTIONS_H_
- #define LIB_MACAROON_EXCEPTIONS_H_
- #include <stdexcept>
- namespace macaroons {
- class exception: public std::exception {
- public:
- exception() {
- }
- explicit exception(const char* message) :
- msg_(message) {
- }
- explicit exception(const std::string& message) :
- msg_(message) {
- }
- virtual ~exception() throw () {
- }
- virtual const char* what() const throw () {
- return msg_.c_str();
- }
- protected:
- std::string msg_;
- };
- class authentication_exception: public exception {
- public:
- explicit authentication_exception(const char* message) :
- msg_(message) {
- }
- explicit authentication_exception(const std::string& message) :
- msg_(message) {
- }
- virtual ~authentication_exception() throw () {
- }
- virtual const char* what() const throw () {
- return msg_.c_str();
- }
- protected:
- std::string msg_;
- };
- }
- #endif /* LIB_MACAROON_EXCEPTIONS_H_ */
|