00001 #ifndef PSANA_EXCEPTIONS_H 00002 #define PSANA_EXCEPTIONS_H 00003 00004 //-------------------------------------------------------------------------- 00005 // File and Version Information: 00006 // $Id: Exceptions.h 5116 2013-01-14 21:32:08Z salnikov@SLAC.STANFORD.EDU $ 00007 // 00008 // Description: 00009 // Class Exceptions. 00010 // 00011 //------------------------------------------------------------------------ 00012 00013 //----------------- 00014 // C/C++ Headers -- 00015 //----------------- 00016 00017 //---------------------- 00018 // Base Class Headers -- 00019 //---------------------- 00020 #include "ErrSvc/Issue.h" 00021 00022 //------------------------------- 00023 // Collaborating Class Headers -- 00024 //------------------------------- 00025 00026 //------------------------------------ 00027 // Collaborating Class Declarations -- 00028 //------------------------------------ 00029 00030 // --------------------- 00031 // -- Class Interface -- 00032 // --------------------- 00033 00034 namespace psana { 00035 00036 /** 00037 * @brief Base class for exceptions for psana package. 00038 * 00039 * This software was developed for the LCLS project. If you use all or 00040 * part of it, please give an appropriate acknowledgment. 00041 * 00042 * @version \$Id: Exceptions.h 5116 2013-01-14 21:32:08Z salnikov@SLAC.STANFORD.EDU $ 00043 * 00044 * @author Andrei Salnikov 00045 */ 00046 00047 class Exception : public ErrSvc::Issue { 00048 public: 00049 00050 /// Constructor takes the reason for an exception 00051 Exception ( const ErrSvc::Context& ctx, const std::string& what ) ; 00052 00053 }; 00054 00055 /// Exception thrown when module name is incorrect 00056 class ExceptionModuleName : public Exception { 00057 public: 00058 00059 /// Constructor takes the name of the module 00060 ExceptionModuleName ( const ErrSvc::Context& ctx, const std::string& module ) ; 00061 00062 }; 00063 00064 /// Exception class which extracts error info from errno. 00065 class ExceptionErrno : public Exception { 00066 public: 00067 00068 /// Constructor takes the reason for an exception 00069 ExceptionErrno ( const ErrSvc::Context& ctx, const std::string& what ) ; 00070 00071 }; 00072 00073 /// Exception thrown for dlopen/dlsym errors. 00074 class ExceptionDlerror : public Exception { 00075 public: 00076 00077 /// Constructor takes the reason for an exception 00078 ExceptionDlerror(const ErrSvc::Context& ctx, const std::string& what); 00079 00080 }; 00081 00082 /// Exception thrown when modules request abort. 00083 class ExceptionAbort : public Exception { 00084 public: 00085 00086 /// Constructor takes the reason for an exception 00087 ExceptionAbort(const ErrSvc::Context& ctx, const std::string& what); 00088 00089 }; 00090 00091 } // namespace psana 00092 00093 #endif // PSANA_EXCEPTIONS_H