ROSE  0.9.9.139
util/Sawyer/Exception.h
1 // WARNING: Changes to this file must be contributed back to Sawyer or else they will
2 // be clobbered by the next update from Sawyer. The Sawyer repository is at
3 // https://github.com/matzke1/sawyer.
4 
5 
6 
7 
8 #ifndef Sawyer_Exception_H
9 #define Sawyer_Exception_H
10 
11 #include <Sawyer/Sawyer.h>
12 
13 namespace Sawyer {
14 namespace Exception {
15 
17 class SAWYER_EXPORT RuntimeError: public std::runtime_error {
18 public:
19  ~RuntimeError() throw() {}
20 
22  explicit RuntimeError(const std::string &mesg)
23  : std::runtime_error(mesg) {}
24 };
25 
27 class SAWYER_EXPORT DomainError: public RuntimeError {
28 public:
29  ~DomainError() throw() {}
30 
32  explicit DomainError(const std::string &mesg)
33  : RuntimeError(mesg) {}
34 };
35 
39 class SAWYER_EXPORT NotFound: public DomainError {
40 public:
41  ~NotFound() throw () {}
42 
44  explicit NotFound(const std::string &mesg)
45  : DomainError(mesg) {}
46 };
47 
51 class SAWYER_EXPORT AlreadyExists: public DomainError {
52 public:
53  ~AlreadyExists() throw () {}
54 
56  AlreadyExists(const std::string &mesg)
57  : DomainError(mesg) {}
58 };
59 
64 class SAWYER_EXPORT ContainsCycle: public DomainError {
65 public:
66  ~ContainsCycle() throw () {}
67 
69  ContainsCycle(const std::string &mesg)
70  : DomainError(mesg) {}
71 };
72 
76 class SAWYER_EXPORT FilesystemError: public RuntimeError {
77 public:
78  ~FilesystemError() throw () {}
79 
81  FilesystemError(const std::string &mesg)
82  : RuntimeError(mesg) {}
83 };
84 
86 class SAWYER_EXPORT SyntaxError: public RuntimeError {
87 public:
88  ~SyntaxError() throw () {
89  }
90 
92  SyntaxError(const std::string &mesg)
93  : RuntimeError(mesg) {}
94 };
95 
96 
97 } // namespace
98 } // namespace
99 
100 #endif
Error related to the file system.
ContainsCycle(const std::string &mesg)
Constructor taking a description of the error.
Error in parsing something.
RuntimeError(const std::string &mesg)
Constructor taking a description of the error.
FilesystemError(const std::string &mesg)
Constructor taking a description of the error.
STL namespace.
Base class for Sawyer runtime errors.
Name space for the entire library.
Definition: Access.h:11
AlreadyExists(const std::string &mesg)
Constructor taking a description of the error.
SyntaxError(const std::string &mesg)
Constructor taking a description of the error.
Error for existing values.
Error when a cycle is detected.
Error for non-existing values.
DomainError(const std::string &mesg)
Constructor taking a description of the error.
NotFound(const std::string &mesg)
Constructor taking a description of the error.
Base class for Sawyer domain errors.