CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CMSexception.cc
Go to the documentation of this file.
4 
8 
10  LockMutex a(mutex);
11  count_++;
12 }
13 
15  LockMutex a(mutex);
16  count_++;
17  //this is bad but needed in order to make transition
18  it = new cms::Exception(err);
19 }
20 
21 void UncatchedException::dump(std::ostream & o, bool det) {
22  if (!it) return;
23  Genexception * exp = dynamic_cast<Genexception*>(it);
24  if (exp) exp->dump(o,det);
25  else o << it->what() << std::endl;
26 }
27 
29  if (count()==0) return;
30  std::string mess("found "); mess+=toa()(count());
31  mess+= " uncaught exceptions";
32  if (!it) throw Genexception(mess);
33 
34  //bad but needed in order to make transition to standard CMS exceptions
35  throw *it;
36  //it->rethrow();
37 
38 }
39 
41  LockMutex a(mutex);
42  return count_;
43 }
44 
45 //-------------------------------------------------------------------
46 
48 
49 
50 BaseGenexception::BaseGenexception(const std::string & mess) throw() :
51  message(mess) {}
52 
54  /* cout << "deleting a BaseGenexception " << message << " at " << this << endl; */
55 }
56 
57 //-------------------------------------------------------------------
58 
60 
61 
62 Genexception::Genexception(const std::string & mess) throw() :
63  BaseGenexception(mess) {
64  traceit();
65 }
66 
67 
69 
71  if (in==0) return;
72  // push in the stack...
73  if (next.get()) (*next).add(in);
75 }
76 
77 #include<iostream>
78 void Genexception::dump(std::ostream & o, bool it) const throw() {
79  if (next.get()) {
80  (*next).dump(o,it);
81  o << "Generated by: " ;
82  }
83  o << what() << "\n" << std::endl;
84  if(it) o << trace()<< std::endl;
85 }
86 
88 #include<sstream>
89 
91  std::ostringstream oss;
92 
93  BackTrace a;
94  a.trace(oss);
95  trace_ = oss.str();
96 }
97 
98 namespace Capri {
99  namespace details {
100  static std::string from(" from ");
101  }
102 }
103 
104 Capri::Error::Error(const std::string & level, const std::string & mess) throw() :
106 
107 
109 GenTerminate::GenTerminate(const std::string & mess) throw() : Genexception(mess) {}
111 
112 
virtual char const * what() const
Definition: Exception.cc:141
Error(const std::string &level, const std::string &mess)
void traceit()
Definition: CMSexception.cc:90
std::string trace_
Definition: CMSexception.h:76
static cms::Exception * it
void dump(std::ostream &o, bool it=false) const
Definition: CMSexception.cc:78
Definition: ioutils.h:94
void trace() const
Definition: BackTrace.cc:8
static LockMutex::Mutex mutex
static void dump(std::ostream &o, bool det=false)
Definition: CMSexception.cc:21
double trace(const ROOT::Math::SMatrix< double, N, N > &matrix)
static std::string from(" from ")
virtual ~BaseGenexception()
Definition: CMSexception.cc:53
double a
Definition: hdecay.h:121
static int count()
Definition: CMSexception.cc:40
virtual ~GenTerminate()
tuple level
Definition: testEve_cfg.py:34
void add(Genexception *in)
Definition: CMSexception.cc:70
static void rethrow()
Definition: CMSexception.cc:28
virtual ~Genexception()
Definition: CMSexception.cc:68