ROSE  0.11.96.11
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
Sawyer::Exception::SyntaxError
Error in parsing something.
Definition: util/Sawyer/Exception.h:86
Sawyer::Exception::ContainsCycle
Error when a cycle is detected.
Definition: util/Sawyer/Exception.h:64
Sawyer::Exception::RuntimeError::RuntimeError
RuntimeError(const std::string &mesg)
Constructor taking a description of the error.
Definition: util/Sawyer/Exception.h:22
Sawyer::Exception::NotFound
Error for non-existing values.
Definition: util/Sawyer/Exception.h:39
Sawyer::Exception::SyntaxError::SyntaxError
SyntaxError(const std::string &mesg)
Constructor taking a description of the error.
Definition: util/Sawyer/Exception.h:92
Sawyer::Exception::AlreadyExists::AlreadyExists
AlreadyExists(const std::string &mesg)
Constructor taking a description of the error.
Definition: util/Sawyer/Exception.h:56
Sawyer::Exception::DomainError
Base class for Sawyer domain errors.
Definition: util/Sawyer/Exception.h:27
Sawyer::Exception::FilesystemError
Error related to the file system.
Definition: util/Sawyer/Exception.h:76
Sawyer::Exception::AlreadyExists
Error for existing values.
Definition: util/Sawyer/Exception.h:51
Sawyer::Exception::FilesystemError::FilesystemError
FilesystemError(const std::string &mesg)
Constructor taking a description of the error.
Definition: util/Sawyer/Exception.h:81
Sawyer
Name space for the entire library.
Definition: Access.h:13
Sawyer::Exception::ContainsCycle::ContainsCycle
ContainsCycle(const std::string &mesg)
Constructor taking a description of the error.
Definition: util/Sawyer/Exception.h:69
Sawyer::Exception::RuntimeError
Base class for Sawyer runtime errors.
Definition: util/Sawyer/Exception.h:17
Sawyer::Exception::DomainError::DomainError
DomainError(const std::string &mesg)
Constructor taking a description of the error.
Definition: util/Sawyer/Exception.h:32
Sawyer::Exception::NotFound::NotFound
NotFound(const std::string &mesg)
Constructor taking a description of the error.
Definition: util/Sawyer/Exception.h:44