diff options
Diffstat (limited to 'libdimensionxx/dimensionxx/error.hpp')
-rw-r--r-- | libdimensionxx/dimensionxx/error.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libdimensionxx/dimensionxx/error.hpp b/libdimensionxx/dimensionxx/error.hpp index 8919895..99670cb 100644 --- a/libdimensionxx/dimensionxx/error.hpp +++ b/libdimensionxx/dimensionxx/error.hpp @@ -21,21 +21,29 @@ #ifndef DIMENSIONXX_ERROR_HPP #define DIMENSIONXX_ERROR_HPP +// Wrappers for libdimension error handling, and an exception class. +// dmnsn_error is still used by libdimensionxx whenever an exception shouldn't +// be thrown, like in destructors, and whenever libdimension or libdimension-* +// use it internally. Exceptions are thrown otherwise to report errors. + #include <dimension.h> #include <stdexcept> #include <string> namespace Dimension { + // Wrapper for dmnsn_severity enum Severity { SEVERITY_LOW = DMNSN_SEVERITY_LOW, SEVERITY_MEDIUM = DMNSN_SEVERITY_MEDIUM, SEVERITY_HIGH = DMNSN_SEVERITY_HIGH }; + // Get or set the resilience, thread-safely Severity resilience(); void resilience(Severity resilience); + // Generic exception class, derives from std::runtime_error class Dimension_Error : public std::runtime_error { public: |