Line data Source code
1 : #ifndef HEPMC_IO_EXCEPTION_H
2 : #define HEPMC_IO_EXCEPTION_H
3 : // ----------------------------------------------------------------------
4 : //
5 : // IO_Exception.h
6 : // Author: Lynn Garren
7 : //
8 : // IO exception handling
9 : // IO_GenEvent, etc. catch the throw and set data members with the error type and message
10 : // Some of the messages are constructed with transient information
11 : // (e.g., contents of a bad GenParticle)
12 : //
13 : // ----------------------------------------------------------------------
14 :
15 :
16 :
17 : #include <stdexcept>
18 :
19 : namespace HepMC {
20 :
21 : //! IO exception handling
22 :
23 : ///
24 : /// \class IO_Exception
25 : /// IO_GenEvent, etc. catch the throw and set data members with the error type and message
26 : /// Some of the messages are constructed with transient information
27 : /// (e.g., contents of a bad GenParticle)
28 0 : class IO_Exception : public std::runtime_error {
29 : public:
30 : IO_Exception(const std::string & msg)
31 0 : : std::runtime_error(msg) { }
32 :
33 : /// IO error types
34 : enum ErrorType{ OK,
35 : NullEvent,
36 : WrongFileType,
37 : MissingStartKey,
38 : EndOfStream,
39 : EndKeyMismatch,
40 : MissingEndKey,
41 : InvalidData,
42 : InputAndOutput,
43 : BadOutputStream,
44 : BadInputStream };
45 :
46 : };
47 :
48 : } // namespace HepMC
49 :
50 : #endif // HEPMC_IO_EXCEPTION_H
|