lib/fmt/RuntimeError: new library

Replacing FormatRuntimeError().
This commit is contained in:
Max Kellermann
2022-11-28 21:58:21 +01:00
parent 45b13fc2a6
commit fa58db798b
105 changed files with 551 additions and 502 deletions

View File

@@ -30,12 +30,12 @@
#include "lib/curl/Handler.hxx"
#include "lib/curl/Escape.hxx"
#include "lib/expat/ExpatParser.hxx"
#include "lib/fmt/RuntimeError.hxx"
#include "fs/Traits.hxx"
#include "event/InjectEvent.hxx"
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
#include "util/ASCII.hxx"
#include "util/RuntimeError.hxx"
#include "util/SpanCast.hxx"
#include "util/StringCompare.hxx"
#include "util/StringFormat.hxx"
@@ -302,8 +302,8 @@ private:
/* virtual methods from CurlResponseHandler */
void OnHeaders(unsigned status, Curl::Headers &&headers) final {
if (status != 207)
throw FormatRuntimeError("Status %d from WebDAV server; expected \"207 Multi-Status\"",
status);
throw FmtRuntimeError("Status {} from WebDAV server; expected \"207 Multi-Status\"",
status);
if (!IsXmlContentType(headers))
throw std::runtime_error("Unexpected Content-Type from WebDAV server");

View File

@@ -23,6 +23,7 @@
#include "storage/StorageInterface.hxx"
#include "storage/FileInfo.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "lib/fmt/RuntimeError.hxx"
#include "lib/dbus/Glue.hxx"
#include "lib/dbus/AsyncRequest.hxx"
#include "lib/dbus/Message.hxx"
@@ -38,7 +39,6 @@
#include "fs/AllocatedPath.hxx"
#include "util/Domain.hxx"
#include "util/StringCompare.hxx"
#include "util/RuntimeError.hxx"
#include "Log.hxx"
#include <stdexcept>
@@ -180,8 +180,8 @@ UdisksStorage::OnListReply(ODBus::Message reply) noexcept
});
if (dbus_path.empty())
throw FormatRuntimeError("No such UDisks2 object: %s",
id.c_str());
throw FmtRuntimeError("No such UDisks2 object: {}",
id);
if (!mount_point.empty()) {
/* already mounted: don't attempt to mount