diff options
author | crupest <crupest@outlook.com> | 2022-01-25 17:48:53 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-01-25 17:48:53 +0800 |
commit | 71c01a175a939d1a519ab235fdfdeec1101f8b84 (patch) | |
tree | 5d639e2f7bdfd08348e41bb2a64c67f0c5662d2f /src/common/platform/unix/ErrnoException.cpp | |
parent | 839292efaaf8d997b2cbca7abae8c6e575f6c01a (diff) | |
download | cru-71c01a175a939d1a519ab235fdfdeec1101f8b84.tar.gz cru-71c01a175a939d1a519ab235fdfdeec1101f8b84.tar.bz2 cru-71c01a175a939d1a519ab235fdfdeec1101f8b84.zip |
...
Diffstat (limited to 'src/common/platform/unix/ErrnoException.cpp')
-rw-r--r-- | src/common/platform/unix/ErrnoException.cpp | 14 |
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 |