00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __EXCEPTIONS_H__
00009 #define __EXCEPTIONS_H__
00010
00011 #include <iostream>
00012 #include <exception>
00013
00014 using namespace std;
00015
00016 class BadAuthException : public exception
00017 {
00018 public:
00019 BadAuthException() {}
00020 virtual ~BadAuthException() throw() {}
00021
00022 virtual const char *what() const throw() { return "Authorization error"; }
00023 };
00024
00025 class InvalidArgument : public exception
00026 {
00027 private:
00028 string _arg;
00029
00030 public:
00031 InvalidArgument(string anArg) : _arg(anArg) {}
00032 virtual ~InvalidArgument() throw() {};
00033
00034 virtual const char *what() const throw() {
00035 string msg = "Invalid argument - " + _arg;
00036 return msg.c_str();
00037 }
00038 };
00039
00040 #endif