CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
exctest1.cc File Reference
#include <iostream>
#include "CLHEP/Exceptions/ZMexception.h"
#include "CLHEP/Exceptions/ZMexAction.h"
#include "CLHEP/Exceptions/ZMexClassInfo.h"
#include "CLHEP/Exceptions/ZMexSeverity.h"
#include "CLHEP/Exceptions/ZMthrow.h"

Go to the source code of this file.

Functions

 ZMexStandardDefinition (ZMexception, Oops)
 
int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 18 of file exctest1.cc.

18 {
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 ZMthrow(userExcept)
Definition: ZMthrow.h:97
Definition: exctest2.cc:14

◆ ZMexStandardDefinition()

ZMexStandardDefinition ( ZMexception  ,
Oops   
)