summaryrefslogtreecommitdiff
path: root/klm/util/exception.hh
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2014-01-27 17:42:19 -0800
committerKenneth Heafield <github@kheafield.com>2014-01-27 17:42:19 -0800
commit783c57b2d3312738ddcf992ac55ff750afe7cb47 (patch)
treec4811dab0d916836b8631f3c7df94f284a490b9b /klm/util/exception.hh
parentf7e051a05d65ef25c2ada0b84cd82bfb375ef265 (diff)
KenLM 5cc905bc2d214efa7de2db56a9a672b749a95591
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: