summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/system/Error.hxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/system/Error.hxx b/src/system/Error.hxx
index a22c3ba29..5027e6864 100644
--- a/src/system/Error.hxx
+++ b/src/system/Error.hxx
@@ -147,6 +147,18 @@ FormatErrno(const char *fmt, Args&&... args) noexcept
return FormatErrno(errno, fmt, std::forward<Args>(args)...);
}
+template<typename... Args>
+static inline std::system_error
+FormatFileNotFound(const char *fmt, Args&&... args) noexcept
+{
+#ifdef _WIN32
+ return FormatLastError(ERROR_FILE_NOT_FOUND, fmt,
+ std::forward<Args>(args)...);
+#else
+ return FormatErrno(ENOENT, fmt, std::forward<Args>(args)...);
+#endif
+}
+
gcc_pure
inline bool
IsErrno(const std::system_error &e, int code) noexcept