Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
messagefacility
messagefacility
test
Utilities
ExceptionDerived_t.cc
Go to the documentation of this file.
1
#include "cetlib_except/exception.h"
2
3
#include <iostream>
4
#include <string>
5
6
struct
Thing
:
public
cet::exception
{
7
Thing
(
const
std::string
&
msg
) :
exception
(
"Thing"
, msg) {}
8
};
9
10
std::ostream&
11
operator<<
(std::ostream& os,
const
Thing
&
t
)
12
{
13
os <<
"Thing("
<< t.explain_self() <<
")"
;
14
return
os;
15
}
16
17
[[noreturn]]
void
18
func3
()
19
{
20
throw
Thing
(
"Data Corrupt"
) <<
" Low level error"
<<
std::endl
;
21
}
22
23
[[noreturn]]
void
24
func2
()
25
{
26
func3
();
27
}
28
29
[[noreturn]]
void
30
func1
()
try
{
31
func2
();
32
}
33
catch
(
cet::exception
&
e
) {
34
throw
cet::exception
(
"InfiniteLoop"
,
"In func2"
,
e
) <<
"Gave up"
;
35
}
36
37
int
38
main
()
try
{
39
func1
();
40
}
41
catch
(
cet::exception
&
e
) {
42
std::cerr <<
"*** main caught cet::exception, output is ***\n"
43
<<
"("
<<
e
.explain_self() <<
")"
44
<<
"*** After exception output ***"
<<
std::endl
;
45
46
std::cerr <<
"\nCategory name list:\n"
;
47
}
Thing::Thing
Thing()
Definition:
Exception_t.cc:10
msg
void msg(const char *fmt,...)
Definition:
message.cpp:107
string
std::string string
Definition:
nybbler.cc:12
Thing
Definition:
Exception_t.cc:9
operator<<
std::ostream & operator<<(std::ostream &os, const Thing &t)
Definition:
ExceptionDerived_t.cc:11
e
const double e
Definition:
gUpMuFluxGen.cxx:165
func3
void func3()
Definition:
ExceptionDerived_t.cc:18
reco_momentum_tuples.t
t
Definition:
reco_momentum_tuples.py:25
main
int main()
Definition:
ExceptionDerived_t.cc:38
func2
void func2()
Definition:
ExceptionDerived_t.cc:24
Thing::Thing
Thing(const std::string &msg)
Definition:
ExceptionDerived_t.cc:7
fhicl::exception
cet::coded_exception< error, detail::translate > exception
Definition:
exception.h:33
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
func1
void func1()
Definition:
ExceptionDerived_t.cc:30
Generated by
1.8.11