00001 #ifndef EDG_WORKLOAD_COMMON_CLIENT_CREDENTIALEXCEPTION_H
00002 #define EDG_WORKLOAD_COMMON_CLIENT_CREDENTIALEXCEPTION_H
00003
00004
00005
00006
00007
00008
00009
00010 #include "edg/workload/common/utilities/Exceptions.h"
00011 #include "edg/workload/userinterface/client/exception_codes.h"
00012
00013
00014 USERINTERFACE_NAMESPACE_BEGIN
00022 class CredentialException : public edg::workload::common::utilities::Exception{
00023 public:
00027 CredentialException ( std::string file,
00028 int line,
00029 std::string method,
00030 int code,
00031 std::string exception_name):
00032 Exception(file,line,method,code , exception_name ){};
00033
00034 };
00035
00036
00037
00041 class CredProxyException : public CredentialException {
00042 public:
00046 CredProxyException ( std::string file,
00047 int line,
00048 std::string method,
00049 int code,
00050 std::string field
00051 ):
00052 CredentialException(file,line,method,code , "CredProxyException"){
00053 this->error_message = "Unable to "+field +" the proxy certificate file" ;
00054 };
00055 };
00056
00057
00061 class ProxyException : public CredentialException {
00062 public:
00066 ProxyException ( std::string file,
00067 int line,
00068 std::string method):
00069 CredentialException(file,line,method, WL_PROXY , "ProxyException"){
00070 this->error_message = "Unable to get credential" ;
00071 };
00072 };
00073
00074
00077 class VomsException : public CredentialException {
00078 public:
00082 VomsException ( std::string file,
00083 int line,
00084 std::string method,
00085 int code,
00086 std::string field = "" ):
00087 CredentialException(file,line,method, WL_PROXY , "VomsException"){
00088 switch( code){
00089 case WL_VO_LOAD:
00090 this->error_message = "Unable to Load VirtualOrganisation certificate. SSL method: " + field + " failed.";
00091 break;
00092 case WL_VO_TYPE:
00093 this->error_message = "Unbable to retrieve voms groups for VirtualOrganisation: " + field ;
00094 break;
00095 default:
00096 this->error_message = "Unable to find default VirtualOrganisation name" ;
00097 }
00098 };
00099 };
00100
00101
00102
00106 class CredKeyException : public CredentialException {
00107 public:
00111 CredKeyException ( std::string file,
00112 int line,
00113 std::string method,
00114 int code
00115 ):
00116 CredentialException(file,line,method,code , "CredKeyException"){
00117 this->error_message = "Unable to load public key from proxy" ;
00118 };
00119 };
00120
00121
00122 } USERINTERFACE_NAMESPACE_END
00123 #endif