output/MultipleOutputs: throw exception instead of calling FatalError()
This commit is contained in:
parent
868bf752f3
commit
509f62f68d
@ -25,11 +25,11 @@
|
|||||||
#include "MusicBuffer.hxx"
|
#include "MusicBuffer.hxx"
|
||||||
#include "MusicPipe.hxx"
|
#include "MusicPipe.hxx"
|
||||||
#include "MusicChunk.hxx"
|
#include "MusicChunk.hxx"
|
||||||
#include "system/FatalError.hxx"
|
|
||||||
#include "config/Block.hxx"
|
#include "config/Block.hxx"
|
||||||
#include "config/ConfigGlobal.hxx"
|
#include "config/ConfigGlobal.hxx"
|
||||||
#include "config/ConfigOption.hxx"
|
#include "config/ConfigOption.hxx"
|
||||||
#include "notify.hxx"
|
#include "notify.hxx"
|
||||||
|
#include "util/RuntimeError.hxx"
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
@ -58,11 +58,10 @@ try {
|
|||||||
pc);
|
pc);
|
||||||
} catch (const std::runtime_error &e) {
|
} catch (const std::runtime_error &e) {
|
||||||
if (block.line > 0)
|
if (block.line > 0)
|
||||||
FormatFatalError("line %i: %s",
|
std::throw_with_nested(FormatRuntimeError("Failed to configure output in line %i",
|
||||||
block.line,
|
block.line));
|
||||||
e.what());
|
|
||||||
else
|
else
|
||||||
FatalError(e.what());
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -73,8 +72,8 @@ MultipleOutputs::Configure(EventLoop &event_loop, PlayerControl &pc)
|
|||||||
auto output = LoadOutput(event_loop, mixer_listener,
|
auto output = LoadOutput(event_loop, mixer_listener,
|
||||||
pc, *param);
|
pc, *param);
|
||||||
if (FindByName(output->name) != nullptr)
|
if (FindByName(output->name) != nullptr)
|
||||||
FormatFatalError("output devices with identical "
|
throw FormatRuntimeError("output devices with identical "
|
||||||
"names: %s", output->name);
|
"names: %s", output->name);
|
||||||
|
|
||||||
outputs.push_back(output);
|
outputs.push_back(output);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user