#include "CLHEP/Exceptions/ZMthrow.h"
#include "CLHEP/Exceptions/ZMexception.h"
#include "CLHEP/Exceptions/ZMexAction.h"
#include "CLHEP/Exceptions/ZMexClassInfo.h"
#include "CLHEP/Exceptions/ZMexSeverity.h"
#include <iostream>
Go to the source code of this file.
◆ main()
Definition at line 28 of file testThrowFrom.cc.
28 {
29
30
31
32
33
34
36
38
39
40
42 "directory/subdirectory/fictitious.file" );
43
44 ZMthrow_from( ZMxTest(
"Artificial backslash Exception"), 4000,
45 "directory/subdirectory\\fictitious.file" );
46
47 ZMthrow_from( ZMxTest(
"Artificial no slash Exception"), 4000,
48 "fictitious.file" );
49
50 ZMthrow( ZMxTest(
"Normal exception") );
51
52 ZMxTest::setName("MyExName");
53 ZMthrow( ZMxTest(
"Exception with new name") );
54
55 ZMxTest::setFacility("newFacility");
56 ZMthrow( ZMxTest(
"Exception from new facility") );
57
58
59
60
61
63
65#ifndef DEFECT_NO_EXCEPTIONS
66 try {
67#endif
68 ZMthrow( ZMxTest(
"Ordinary Error") );
69#ifndef DEFECT_NO_EXCEPTIONS
70 }
72 std::cerr <<
"Caught: " << e.
name() <<
"\n";
73 }
74#endif
75
76 return 0;
77
78}
#define ZMthrow(userExcept)
#define ZMthrow_from(userExcept, line, file)
virtual std::string name() const
◆ ZMexStandardDefinition()