00001 //-------------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id: Exceptions.cpp 7696 2014-02-27 00:40:59Z salnikov@SLAC.STANFORD.EDU $ 00004 // 00005 // Description: 00006 // Class Exceptions... 00007 // 00008 // Author List: 00009 // Andrei Salnikov 00010 // 00011 //------------------------------------------------------------------------ 00012 00013 //----------------------- 00014 // This Class's Header -- 00015 //----------------------- 00016 #include "PSXtcInput/Exceptions.h" 00017 00018 //----------------- 00019 // C/C++ Headers -- 00020 //----------------- 00021 #include <cerrno> 00022 00023 //------------------------------- 00024 // Collaborating Class Headers -- 00025 //------------------------------- 00026 00027 //----------------------------------------------------------------------- 00028 // Local Macros, Typedefs, Structures, Unions and Forward Declarations -- 00029 //----------------------------------------------------------------------- 00030 00031 // ---------------------------------------- 00032 // -- Public Function Member Definitions -- 00033 // ---------------------------------------- 00034 00035 namespace PSXtcInput { 00036 00037 //---------------- 00038 // Constructors -- 00039 //---------------- 00040 Exception::Exception (const ErrSvc::Context& ctx, 00041 const std::string& className, 00042 const std::string& what) 00043 : ErrSvc::Issue(ctx, className+": "+what) 00044 { 00045 } 00046 00047 ExceptionErrno::ExceptionErrno ( const ErrSvc::Context& ctx, const std::string& what ) 00048 : Exception( ctx, "ExceptionErrno", what + ": " + std::strerror(errno) ) 00049 { 00050 } 00051 00052 } // namespace PSXtcInput