aboutsummaryrefslogtreecommitdiff
path: root/src/common/platform/unix/ErrnoException.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/platform/unix/ErrnoException.cpp')
-rw-r--r--src/common/platform/unix/ErrnoException.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/common/platform/unix/ErrnoException.cpp b/src/common/platform/unix/ErrnoException.cpp
new file mode 100644
index 00000000..14e6a5a2
--- /dev/null
+++ b/src/common/platform/unix/ErrnoException.cpp
@@ -0,0 +1,14 @@
+#include "cru/common/platform/unix/ErrnoException.hpp"
+
+#include "cru/common/Format.hpp"
+
+#include <errno.h>
+
+namespace cru::platform::unix {
+ErrnoException::ErrnoException(const String& message)
+ : ErrnoException(message, errno) {}
+
+ErrnoException::ErrnoException(const String& message, int errno_code)
+ : PlatformException(Format(u"{}. Errno is {}.", message, errno_code)),
+ errno_code_(errno_code) {}
+} // namespace cru::platform::unix