00001 #ifndef _SocketExceptions_h_
00002 #define _SocketExceptions_h_
00003
00004
00005
00006
00007
00008
00009 #include "edg/workload/common/utilities/Exceptions.h"
00010 #include "edg/workload/common/socket++/exception_codes.h"
00011
00012 namespace utilities = edg::workload::common::utilities;
00013
00014 namespace edg {
00015 namespace workload {
00016 namespace common {
00017 namespace socket_pp {
00018
00019 class Exception : public utilities::Exception
00020 {
00021 protected:
00022 Exception() {}
00023 Exception(const std::string& s, const std::string& m, int c, const std::string& n) :
00024 utilities::Exception(s, m, c, n) {}
00025 };
00026
00027 struct IOException : socket_pp::Exception
00028 {
00029 IOException( const std::string& source, const std::string& method, const std::string& message) :
00030 socket_pp::Exception( source, method, SOCKET_IO_ERROR, "IOException" ) {
00031 this -> error_message = message;
00032 }
00033 };
00034
00035 class GSIException : public socket_pp::Exception
00036 {
00037 protected:
00038 GSIException(const std::string& s, const std::string& m, int c, const std::string& n) : socket_pp::Exception(s,m,c,n) {}
00039 GSIException() {}
00040 };
00041
00042 struct AuthorizationException : GSIException
00043 {
00044 AuthorizationException( const std::string& source, const std::string& method, const std::string& message ) :
00045 GSIException( source, method, SOCKET_AUTHORIZATION_ERROR, "AuthorizationException" ) {
00046 this -> error_message = message;
00047 }
00048 };
00049
00050 struct AuthenticationException : GSIException
00051 {
00052 AuthenticationException( std::string source, std::string method, std::string message ) :
00053 GSIException( source, method, SOCKET_AUTHENTICATION_ERROR, "AuthenticationException") {
00054 this -> error_message = message;
00055 }
00056 };
00057
00058 }
00059 }
00060 }
00061 }
00062
00063 #endif