CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
exctest4.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 21 of file exctest4.cc.

21 {
22
23 cerr << "Starting main() ..." << endl;
24
25#ifndef DEFECT_NO_EXCEPTIONS
26 try {
27#endif
28 //cerr << "About to: Oops::setHandler( ZMexHandler( ZMexIgnoreAlways() ) );
29 //Oops::setHandler( ZMexHandler( ZMexIgnoreAlways() ) );
30
31 cerr << "About to: ZMthrow( Oops(\"Ouch\") )" << endl;
32 ZMthrow( Oops("Ouch") );
33 // unreachable statement:
34 cerr << "Got past: ZMthrow( Oops(\"Ouch\") ) -- not good!" << endl;
35#ifndef DEFECT_NO_EXCEPTIONS
36 }
37 catch ( const Oops &egad ) {
38 cerr << "Caught: Oops" << endl;
39 }
40 catch ( const ZMexception &egad ) {
41 cerr << "Caught: ZMexception" << endl;
42 }
43 catch ( ... ) {
44 cerr << "Caught: don't know what" << endl;
45 }
46#endif
47
48 cerr << "Done." << endl;
49 return 0;
50
51} // main()
#define ZMthrow(userExcept)
Definition: ZMthrow.h:97
Definition: exctest2.cc:14

◆ ZMexStandardDefinition()

ZMexStandardDefinition ( ZMexception  ,
Oops   
)