BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Calibration/rdbModel/include/rdbModel/RdbException.h
Go to the documentation of this file.
1// $Header: /bes/bes/BossCvs/Calibration/rdbModel/rdbModel/RdbException.h,v 1.1.1.1 2005/10/17
2// 06:10:53 maqm Exp $
3#ifndef RDBMODEL_RDBEXCEPTION_H
4#define RDBMODEL_RDBEXCEPTION_H
5#include <exception>
6
7namespace rdbModel {
8
9 class RdbException : std::exception {
10 public:
11 RdbException( const std::string& extraInfo = "", int code = 0 )
12 : std::exception(), m_name( "RdbException" ), m_extra( extraInfo ), m_code( code ) {}
13 virtual ~RdbException() throw() {}
14 virtual std::string getMsg() {
15 std::string msg = m_name + ": " + m_extra;
16 return msg;
17 }
18 virtual int getCode() const { return m_code; }
19 virtual const char* what() { return m_extra.c_str(); }
20
21 protected:
22 std::string m_name;
23
24 private:
25 std::string m_extra;
26 int m_code;
27 };
28
29} // namespace rdbModel
30#endif
RdbException(const std::string &extraInfo="", int code=0)