EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairDbException.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairDbException.cxx
1 
2 
3 #include <iostream>
4 
5 #include "TSQLServer.h"
6 #include "TSQLStatement.h"
7 
8 #include "FairDbException.h"
9 
10 using namespace std;
11 
13 
14 
15 FairDbException::FairDbException(const char* msg /*= 0*/,
16  Int_t code /* = -1 */,
17  Int_t dbType /*= -1 */ ):
18  fMessage(msg),
19  fErrorCode(code),
20  fDbType(dbType)
21 {
22 
23 
24 }
25 
26 
27 FairDbException::FairDbException(const TSQLServer& server,
28  Int_t dbType /*= -1 */ ):
29  fMessage(server.GetErrorMsg()),
30  fErrorCode(server.GetErrorCode()),
31  fDbType(dbType)
32 {
33 
34 
35 }
36 
37 
38 FairDbException::FairDbException(const TSQLStatement& statement,
39  Int_t dbType /*= -1 */ ):
40  fMessage(statement.GetErrorMsg()),
41  fErrorCode(statement.GetErrorCode()),
42  fDbType(dbType)
43 {
44 
45 
46 }
47 
48 
49 
51  : fMessage(that.fMessage),
52  fErrorCode(that.fErrorCode),
53  fDbType(that.fDbType)
54 {
55 
56 
57  *this = that;
58 
59 }
60 
61 
62 
64 {
65 
66 
67 }
68 
69 
70 std::ostream& operator<<(std::ostream& os, const FairDbException& e)
71 {
72 
73  os << "Error " << e.GetErrorCode()
74  << " (" << e.GetMessage() << ") from DB type " << e.GetDbType() << endl;
75  return os;
76 
77 }