00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GLITE_WMS_COMMON_CLIENT_JOBADEXCEPTIONS_H
00021 #define GLITE_WMS_COMMON_CLIENT_JOBADEXCEPTIONS_H
00022
00023 #define GLITE_STACK_JDL_CATCH(exc_name)catch(exc_name &exc){exc.push_back(__FILE__,LINE,METHOD);throw;}
00024 #define GLITE_STACK_JDL_CATCH_ALL() }\
00025 GLITE_STACK_JDL_CATCH(AdSemanticMandatoryException) \
00026 GLITE_STACK_JDL_CATCH(AdSemanticPathException) \
00027 GLITE_STACK_JDL_CATCH(AdSemanticGroupException) \
00028 GLITE_STACK_JDL_CATCH(AdMismatchException) \
00029 GLITE_STACK_JDL_CATCH(AdFormatException) \
00030 GLITE_STACK_JDL_CATCH(AdListException) \
00031 GLITE_STACK_JDL_CATCH(AdEmptyException) \
00032 GLITE_STACK_JDL_CATCH(AdExtractedException) \
00033 GLITE_STACK_JDL_CATCH(glite::wmsutils::exception::Exception) \
00034 catch(std::exception &ex){glite::wmsutils::exception::Exception \
00035 exc(__FILE__,__LINE__,METHOD,0,"Standard exception: "+std::string(ex.what()));throw exc;}
00036
00037
00038
00039
00040
00041
00042 #include "glite/wmsutils/exception/Exception.h"
00043 namespace glite {
00044 namespace jdl {
00045
00055 class RequestAdException : public glite::wmsutils::exception::Exception {
00056 public:
00057 const char* what() throw();
00058 protected:
00062 RequestAdException (std::string file,
00063 int line,
00064 std::string method,
00065 int code,
00066 std::string exception_name) ;
00067 virtual ~RequestAdException() throw () {};
00068 std::string error_description ;
00069 };
00070
00071
00075 class AdClassAdException : public RequestAdException {
00076 public:
00077 AdClassAdException (std::string file,
00078 int line,
00079 std::string method,
00080 int code ,
00081 std::string method_name ,
00082 std::string error_description = "");
00083 };
00084
00085
00086
00090 class AdSyntaxException : public RequestAdException {
00091 public:
00092 AdSyntaxException (std::string file,
00093 int line,
00094 std::string method,
00095 int code ,
00096 std::string attr_name );
00097 };
00098
00099
00100
00104 class AdSemanticException : public RequestAdException {
00105 public:
00109 AdSemanticException (std::string file,
00110 int line,
00111 std::string method,
00112 int code,
00113 std::string exception_name );
00114 };
00115
00119 class AdSemanticMandatoryException : public AdSemanticException {
00120 public:
00124 AdSemanticMandatoryException (std::string file,
00125 int line,
00126 std::string method,
00127 int code,
00128 std::string attr_name );
00129 };
00130
00131
00135 class AdSemanticPathException : public AdSemanticException {
00136 public:
00140 AdSemanticPathException (std::string file,
00141 int line,
00142 std::string method,
00143 int code,
00144 std::string attr_name,
00145 std::string path_name );
00146 };
00147
00151 class AdSemanticGroupException : public AdSemanticException {
00152 public:
00156 AdSemanticGroupException (std::string file,
00157 int line,
00158 std::string method,
00159 int code,
00160 std::string attrs_name );
00161 };
00162
00166 class AdAttributeException : public RequestAdException {
00167 public:
00168 AdAttributeException (std::string file,
00169 int line,
00170 std::string method,
00171 int code,
00172 std::string exception_name );
00173 };
00174
00178 class AdMismatchException : public AdAttributeException {
00179 public:
00183 AdMismatchException (std::string file,
00184 int line,
00185 std::string method,
00186 int code,
00187 std::string attr_name,
00188 std::string error_description = "" );
00189
00190 };
00191
00195 class AdFormatException : public AdAttributeException {
00196 public:
00200 AdFormatException(std::string file,
00201 int line,
00202 std::string method,
00203 int code,
00204 std::string attr_name,
00205 std::string format ="");
00206 };
00210 class AdListException : public AdAttributeException {
00211 public:
00215 AdListException(std::string file,
00216 int line,
00217 std::string method,
00218 int code,
00219 std::string attr_name );
00220
00221 };
00222
00223
00227 class AdEmptyException : public AdAttributeException {
00228 public:
00232 AdEmptyException(std::string file,
00233 int line,
00234 std::string method,
00235 int code,
00236 std::string attr_name );
00237 };
00238
00242 class AdExtractedException: public RequestAdException {
00243 public:
00244 AdExtractedException (std::string file,
00245 int line,
00246 std::string method,
00247 int code,
00248 std::string error_description);
00249 };
00250
00251 }
00252 }
00253
00254 #endif