system/FmtError: new library

Replaces the Format*() functions in system/Error.hxx.
This commit is contained in:
Max Kellermann
2022-11-28 18:49:35 +01:00
parent 124e75c286
commit 96ae659fdf
25 changed files with 305 additions and 186 deletions

View File

@@ -21,7 +21,7 @@
#include "../AsyncInputStream.hxx"
#include "event/Call.hxx"
#include "event/Loop.hxx"
#include "system/Error.hxx"
#include "system/FmtError.hxx"
#include "io/Open.hxx"
#include "io/UniqueFileDescriptor.hxx"
#include "io/uring/ReadOperation.hxx"
@@ -188,7 +188,7 @@ OpenUringInputStream(const char *path, Mutex &mutex)
// TODO: use IORING_OP_STATX
struct stat st;
if (fstat(fd.Get(), &st) < 0)
throw FormatErrno("Failed to access %s", path);
throw FmtErrno("Failed to access {}", path);
if (!S_ISREG(st.st_mode))
throw FormatRuntimeError("Not a regular file: %s", path);