CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
exctest1.cc
Go to the documentation of this file.
1#include <iostream>
2using std::cerr;
3using std::endl;
4
5
6#include "CLHEP/Exceptions/ZMexception.h"
7#include "CLHEP/Exceptions/ZMexAction.h"
8#include "CLHEP/Exceptions/ZMexClassInfo.h"
9#include "CLHEP/Exceptions/ZMexSeverity.h"
10#include "CLHEP/Exceptions/ZMthrow.h"
11using namespace zmex;
12
13
15ZMexClassInfo Oops::_classInfo( "Oops", "exctest1", ZMexERROR );
16
17
18int main() {
19
20 cerr << "Starting main() ..." << endl;
21
22#ifndef DEFECT_NO_EXCEPTIONS
23 try {
24#endif
25 //cerr << "About to: Oops::setHandler( ZMexHandler( ZMexIgnoreAlways() ) );
26 //Oops::setHandler( ZMexHandler( ZMexIgnoreAlways() ) );
27
28 cerr << "About to: ZMthrow( Oops(\"Ouch\") )" << endl;
29 ZMthrow( Oops("Ouch") );
30 // unreachable statement:
31 cerr << "Got past: ZMthrow( Oops(\"Ouch\") ) -- not good!" << endl;
32#ifndef DEFECT_NO_EXCEPTIONS
33 }
34 catch ( const Oops &egad ) {
35 cerr << "Caught: Oops" << endl;
36 }
37 catch ( const ZMexception &egad ) {
38 cerr << "Caught: ZMexception" << endl;
39 }
40 catch ( ... ) {
41 cerr << "Caught: don't know what" << endl;
42 }
43#endif
44
45 cerr << "Done." << endl;
46 return 0;
47
48} // main()
#define ZMexStandardDefinition(Parent, Class)
Definition: ZMexception.h:523
#define ZMthrow(userExcept)
Definition: ZMthrow.h:97
Definition: exctest2.cc:14
int main()
Definition: exctest1.cc:18
Definition: ZMerrno.h:52
@ ZMexERROR
Definition: ZMexSeverity.h:46