aboutsummaryrefslogtreecommitdiff
path: root/include/cru/common/Exception.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2023-07-05 01:54:08 +0800
committercrupest <crupest@outlook.com>2023-07-05 01:54:08 +0800
commitbcfd51a7fabf7adf5f134247ca1020fac98b24b5 (patch)
tree41471cee6af6a7e49140e50ba818366b316c8ea7 /include/cru/common/Exception.h
parentaa9bc6bb7c11e810745c80548dd5ed5b2cb08740 (diff)
downloadcru-bcfd51a7fabf7adf5f134247ca1020fac98b24b5.tar.gz
cru-bcfd51a7fabf7adf5f134247ca1020fac98b24b5.tar.bz2
cru-bcfd51a7fabf7adf5f134247ca1020fac98b24b5.zip
Add CFileStream. Move ErrnoException.
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