aboutsummaryrefslogtreecommitdiff
path: root/include/cru/common/Exception.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/common/Exception.h')
-rw-r--r--include/cru/common/Exception.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/cru/common/Exception.h b/include/cru/common/Exception.h
index 365d2064..6f458d35 100644
--- a/include/cru/common/Exception.h
+++ b/include/cru/common/Exception.h
@@ -29,4 +29,21 @@ class CRU_BASE_API TextEncodeException : public Exception {
public:
using Exception::Exception;
};
+
+class ErrnoException : public Exception {
+ public:
+ ErrnoException() : ErrnoException(String{}) {}
+ explicit ErrnoException(const String& message);
+ ErrnoException(const String& message, int errno_code);
+
+ CRU_DELETE_COPY(ErrnoException)
+ CRU_DELETE_MOVE(ErrnoException)
+
+ ~ErrnoException() override = default;
+
+ int GetErrnoCode() const { return errno_code_; }
+
+ private:
+ int errno_code_;
+};
} // namespace cru