00001 00007 #ifndef __FASP_MANAGER_EXCEPTION_H__ 00008 #define __FASP_MANAGER_EXCEPTION_H__ 00009 00010 #include "FaspManagerCommon.h" 00011 #include <exception> 00012 #include <string> 00013 00014 namespace Aspera 00015 { 00016 namespace FaspManager 00017 { 00018 00020 class Exception 00021 { 00022 /* Member variables */ 00023 protected: 00024 00026 std::string m_err_msg; 00027 00028 /* Member functions */ 00029 public: 00030 00032 FASP_MANAGER_API Exception( ) : m_err_msg( "Generic FASP exception" ) { }; 00033 00034 00038 FASP_MANAGER_API Exception( std::string err_msg ) : m_err_msg( err_msg ) { }; 00039 00041 FASP_MANAGER_API virtual ~Exception( ) { }; 00042 00046 FASP_MANAGER_API const char* GetErrMsg( ) { return m_err_msg.c_str(); }; 00047 }; 00048 00049 00051 class SocketException : public Exception 00052 { 00053 /* Member functions */ 00054 public: 00055 00057 FASP_MANAGER_API SocketException( ) : Exception( ) { }; 00058 00059 00063 FASP_MANAGER_API SocketException( std::string err_msg ) : Exception( err_msg ) { }; 00064 00066 FASP_MANAGER_API ~SocketException( ) { }; 00067 }; 00068 00070 class XferException : public Exception 00071 { 00072 /* Member functions */ 00073 public: 00075 FASP_MANAGER_API XferException( ) : Exception( ) { }; 00076 00080 00081 FASP_MANAGER_API XferException( std::string err_msg ) : Exception( err_msg ) { }; 00082 00084 FASP_MANAGER_API ~XferException( ) { }; 00085 }; 00086 00088 class InvalidOperationException : public Exception 00089 { 00090 /* Member functions */ 00091 public: 00093 FASP_MANAGER_API InvalidOperationException( ) : Exception( ) { }; 00094 00099 FASP_MANAGER_API InvalidOperationException( std::string err_msg ) : Exception( err_msg ) { }; 00100 00102 FASP_MANAGER_API ~InvalidOperationException( ) { }; 00103 }; 00104 00106 class JobNotFoundException : public Exception 00107 { 00108 /* Member functions */ 00109 public: 00110 00112 FASP_MANAGER_API JobNotFoundException( ) : Exception( ) { }; 00113 00118 FASP_MANAGER_API JobNotFoundException( std::string err_msg ) : Exception( err_msg ) { }; 00119 00121 FASP_MANAGER_API ~JobNotFoundException( ) { }; 00122 }; 00123 00124 00126 class SendException : public Exception 00127 { 00128 /* Member functions */ 00129 public: 00130 00132 FASP_MANAGER_API SendException( ) : Exception( ) { }; 00133 00138 FASP_MANAGER_API SendException( std::string err_msg ) : Exception( err_msg ) { }; 00139 00140 00142 FASP_MANAGER_API ~SendException( ) { }; 00143 }; 00144 00146 class StateException : public Exception 00147 { 00148 /* Member functions */ 00149 public: 00151 FASP_MANAGER_API StateException( ) : Exception( ) { }; 00152 00157 FASP_MANAGER_API StateException( std::string err_msg ) : Exception( err_msg ) { }; 00158 00160 FASP_MANAGER_API ~StateException( ) { }; 00161 }; 00162 00164 class ValidationException : public Exception 00165 { 00166 /* Member functions */ 00167 public: 00168 00170 FASP_MANAGER_API ValidationException( ) : Exception( ) { }; 00171 00176 FASP_MANAGER_API ValidationException( std::string err_msg ) : Exception( err_msg ) { }; 00177 00179 FASP_MANAGER_API ~ValidationException( ) { }; 00180 }; 00181 00182 } /* namespace FaspManager */ 00183 } /* namespace Aspera */ 00184 00185 #endif /* __FASP_MANAGER_EXCEPTION_H__ */