summaryrefslogtreecommitdiff
path: root/klm/util/exception.hh
diff options
context:
space:
mode:
Diffstat (limited to 'klm/util/exception.hh')
-rw-r--r--klm/util/exception.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/klm/util/exception.hh b/klm/util/exception.hh
index 74046cf9..0298272b 100644
--- a/klm/util/exception.hh
+++ b/klm/util/exception.hh
@@ -98,6 +98,9 @@ template <class Except, class Data> typename Except::template ExceptionTag<Excep
#define UTIL_THROW_IF(Condition, Exception, Modify) \
UTIL_THROW_IF_ARG(Condition, Exception, , Modify)
+#define UTIL_THROW_IF2(Condition, Modify) \
+ UTIL_THROW_IF_ARG(Condition, util::Exception, , Modify)
+
// Exception that records errno and adds it to the message.
class ErrnoException : public Exception {
public:
@@ -111,6 +114,13 @@ class ErrnoException : public Exception {
int errno_;
};
+// file wasn't there, or couldn't be open for some reason
+class FileOpenException : public Exception {
+ public:
+ FileOpenException() throw() {}
+ ~FileOpenException() throw() {}
+};
+
// Utilities for overflow checking.
class OverflowException : public Exception {
public: