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

@@ -20,10 +20,10 @@
#include "config/Data.hxx"
#include "config/Param.hxx"
#include "config/File.hxx"
#include "lib/fmt/RuntimeError.hxx"
#include "fs/Path.hxx"
#include "fs/NarrowPath.hxx"
#include "util/PrintException.hxx"
#include "util/RuntimeError.hxx"
#include <stdio.h>
#include <stdlib.h>
@@ -40,14 +40,14 @@ try {
const auto option = ParseConfigOptionName(name);
if (option == ConfigOption::MAX)
throw FormatRuntimeError("Unknown setting: %s", name);
throw FmtRuntimeError("Unknown setting: {}", name);
ConfigData config;
ReadConfigFile(config, config_path);
const auto *param = config.GetParam(option);
if (param == nullptr)
throw FormatRuntimeError("No such setting: %s", name);
throw FmtRuntimeError("No such setting: {}", name);
printf("%s\n", param->value.c_str());
return EXIT_SUCCESS;