| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*************************************** | ||
| 2 | Auteur : Thibaut Oprinsen | ||
| 3 | Mail : thibaut.oprinsen@lapp.in2p3.fr | ||
| 4 | Licence : CeCILL-C | ||
| 5 | ****************************************/ | ||
| 6 | |||
| 7 | #ifndef __DAEMON_CONFIG8EXCEPTION_H__ | ||
| 8 | #define __DAEMON_CONFIG8EXCEPTION_H__ | ||
| 9 | |||
| 10 | #include <stdexcept> | ||
| 11 | #include "PString.h" | ||
| 12 | |||
| 13 | namespace Phoenix { | ||
| 14 | ///@brief Base exception class for the Phoenix project | ||
| 15 | class SwarmException : public std::runtime_error { | ||
| 16 | public: | ||
| 17 | SwarmException(const PString& function, const PString& message, const PString& component = ""); | ||
| 18 | |||
| 19 | const PString& getComponent() const; | ||
| 20 | const PString& getMessage() const; | ||
| 21 | const PString& getFunction() const; | ||
| 22 | private: | ||
| 23 | ///Function where the error occurs | ||
| 24 | PString p_function; | ||
| 25 | ///Error Message | ||
| 26 | PString p_message; | ||
| 27 | ///Component of the message | ||
| 28 | PString p_component; | ||
| 29 | }; | ||
| 30 | |||
| 31 | ///Exception for configuration errors | ||
| 32 | class ParserException : public SwarmException { | ||
| 33 | public: | ||
| 34 | ParserException(const PString& function, const PString& message); | ||
| 35 | }; | ||
| 36 | |||
| 37 | ///Exception for daemon configuration errors | ||
| 38 | class ConfigException : public SwarmException { | ||
| 39 | public: | ||
| 40 | ConfigException(const PString& function, const PString& message); | ||
| 41 | }; | ||
| 42 | |||
| 43 | ///Exception for socket status errors | ||
| 44 | class SocketStatusException : public SwarmException { | ||
| 45 | public: | ||
| 46 | SocketStatusException(const PString& function, const PString& message); | ||
| 47 | }; | ||
| 48 | } | ||
| 49 | |||
| 50 | #endif | ||
| 51 | |||
| 52 | |||
| 53 |