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
00021 class BadAuthException : public exception
00022 {
00023 public:
00024 BadAuthException() {}
00025 virtual ~BadAuthException() throw() {}
00026
00027 virtual const char *what() const throw() {
00028 return "Authorization error";
00029 }
00030 };
00031
00037 class InvalidArgument : public exception
00038 {
00039 private:
00040 string _arg;
00041
00042 public:
00043 InvalidArgument(string anArg) : _arg(anArg) {}
00044 virtual ~InvalidArgument() throw() {};
00045
00046 virtual const char *what() const throw() {
00047 string msg = "Invalid argument - " + _arg;
00048 return msg.c_str();
00049 }
00050 };
00051
00052 #endif