EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
ArchiveException.h
1 // -*- c++ -*-
2 
3 #ifndef __ARCHIVEEXCEPTION_H__
4 #define __ARCHIVEEXCEPTION_H__
5 
6 // system
7 #include <stdio.h>
8 #include <string>
9 
10 // tools
11 #include "tools/GenericException.h"
12 
13 // \ingroup Tools
14 
17 
18 public:
19 
20  typedef enum {
21  NoError, // This should never occur...
22  Fail, // Failure
23  Invalid, // Invalid: not initialized, wrong type, ...
24  OpenError, // Cannot open existing new file
25  CreateError,// Cannot create new file
26  ReadError, // Read Error
27  WriteError, // Write Error
28  Unsupported // Not Supported (dbr type,...)
29  } Code;
30 
31  ArchiveException (const char *sourcefile, size_t line, Code code);
32 
33  ArchiveException(const char *sourcefile, size_t line,
34  Code code, const std::string& detail);
35 
36  ~ArchiveException() throw ()
37  {}
38 
39  Code getErrorCode () const
40  { return code; }
41 
42 private:
43  Code code;
44 };
45 
46 // inline? Then e.g. Invalid would have to be given as
47 // ChannelArchiveException::Invalid...
48 #define throwArchiveException(code) \
49  throw ArchiveException(__FILE__, __LINE__,ArchiveException::code)
50 #define throwDetailedArchiveException(code,detail) \
51  throw ArchiveException(__FILE__, __LINE__,ArchiveException::code, detail)
52 
53 #endif //__ARCHIVEEXCEPTION_H__
Exception used by older LibIO code.
Definition: ArchiveException.h:16
Generic Exception: Base class for exceptions.
Definition: GenericException.h:45