From 509f62f68dcca5d8749c955925072b59b9006824 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 24 Nov 2016 14:04:40 +0100 Subject: [PATCH] output/MultipleOutputs: throw exception instead of calling FatalError() --- src/output/MultipleOutputs.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/output/MultipleOutputs.cxx b/src/output/MultipleOutputs.cxx index b5a6a49a7..b0f562af5 100644 --- a/src/output/MultipleOutputs.cxx +++ b/src/output/MultipleOutputs.cxx @@ -25,11 +25,11 @@ #include "MusicBuffer.hxx" #include "MusicPipe.hxx" #include "MusicChunk.hxx" -#include "system/FatalError.hxx" #include "config/Block.hxx" #include "config/ConfigGlobal.hxx" #include "config/ConfigOption.hxx" #include "notify.hxx" +#include "util/RuntimeError.hxx" #include @@ -58,11 +58,10 @@ try { pc); } catch (const std::runtime_error &e) { if (block.line > 0) - FormatFatalError("line %i: %s", - block.line, - e.what()); + std::throw_with_nested(FormatRuntimeError("Failed to configure output in line %i", + block.line)); else - FatalError(e.what()); + throw; } void @@ -73,8 +72,8 @@ MultipleOutputs::Configure(EventLoop &event_loop, PlayerControl &pc) auto output = LoadOutput(event_loop, mixer_listener, pc, *param); if (FindByName(output->name) != nullptr) - FormatFatalError("output devices with identical " - "names: %s", output->name); + throw FormatRuntimeError("output devices with identical " + "names: %s", output->name); outputs.push_back(output); }