lib/fmt/RuntimeError: new library
Replacing FormatRuntimeError().
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "ConfigGlue.hxx"
|
||||
#include "ReadFrames.hxx"
|
||||
#include "lib/fmt/RuntimeError.hxx"
|
||||
#include "fs/Path.hxx"
|
||||
#include "fs/NarrowPath.hxx"
|
||||
#include "filter/LoadOne.hxx"
|
||||
@@ -31,7 +32,6 @@
|
||||
#include "system/Error.hxx"
|
||||
#include "io/FileDescriptor.hxx"
|
||||
#include "util/StringBuffer.hxx"
|
||||
#include "util/RuntimeError.hxx"
|
||||
#include "util/PrintException.hxx"
|
||||
|
||||
#include <cassert>
|
||||
@@ -48,8 +48,8 @@ LoadFilter(const ConfigData &config, const char *name)
|
||||
const auto *param = config.FindBlock(ConfigBlockOption::AUDIO_FILTER,
|
||||
"name", name);
|
||||
if (param == nullptr)
|
||||
throw FormatRuntimeError("No such configured filter: %s",
|
||||
name);
|
||||
throw FmtRuntimeError("No such configured filter: {}",
|
||||
name);
|
||||
|
||||
return filter_configured_new(*param);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "output/Registry.hxx"
|
||||
#include "output/OutputPlugin.hxx"
|
||||
#include "ConfigGlue.hxx"
|
||||
#include "lib/fmt/RuntimeError.hxx"
|
||||
#include "event/Thread.hxx"
|
||||
#include "fs/Path.hxx"
|
||||
#include "fs/NarrowPath.hxx"
|
||||
@@ -29,7 +30,6 @@
|
||||
#include "cmdline/OptionDef.hxx"
|
||||
#include "cmdline/OptionParser.hxx"
|
||||
#include "util/StringBuffer.hxx"
|
||||
#include "util/RuntimeError.hxx"
|
||||
#include "util/ScopeExit.hxx"
|
||||
#include "util/StaticFifoBuffer.hxx"
|
||||
#include "util/PrintException.hxx"
|
||||
@@ -95,8 +95,8 @@ LoadAudioOutput(const ConfigData &config, EventLoop &event_loop,
|
||||
const auto *block = config.FindBlock(ConfigBlockOption::AUDIO_OUTPUT,
|
||||
"name", name);
|
||||
if (block == nullptr)
|
||||
throw FormatRuntimeError("No such configured audio output: %s",
|
||||
name);
|
||||
throw FmtRuntimeError("No such configured audio output: {}",
|
||||
name);
|
||||
|
||||
const char *plugin_name = block->GetBlockValue("type");
|
||||
if (plugin_name == nullptr)
|
||||
@@ -104,8 +104,8 @@ LoadAudioOutput(const ConfigData &config, EventLoop &event_loop,
|
||||
|
||||
const auto *plugin = AudioOutputPlugin_get(plugin_name);
|
||||
if (plugin == nullptr)
|
||||
throw FormatRuntimeError("No such audio output plugin: %s",
|
||||
plugin_name);
|
||||
throw FmtRuntimeError("No such audio output plugin: {}",
|
||||
plugin_name);
|
||||
|
||||
return std::unique_ptr<AudioOutput>(ao_plugin_init(event_loop, *plugin,
|
||||
*block));
|
||||
|
||||
Reference in New Issue
Block a user