summaryrefslogtreecommitdiff
path: root/test/run_filter.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-12-27 12:03:13 +0100
committerMax Kellermann <max@musicpd.org>2017-12-27 12:03:13 +0100
commita2c2288cd6780c3017237c6ca821409b04638549 (patch)
treee297324c27c2b6ec0f78d2822a95564ddc8da716 /test/run_filter.cxx
parentedef62df86416a63efb936d5a5fd40ad1a49d171 (diff)
test/run_filter: throw exception on error
Diffstat (limited to 'test/run_filter.cxx')
-rw-r--r--test/run_filter.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/run_filter.cxx b/test/run_filter.cxx
index bad10169e..3da70a07c 100644
--- a/test/run_filter.cxx
+++ b/test/run_filter.cxx
@@ -29,6 +29,7 @@
#include "mixer/MixerControl.hxx"
#include "util/ConstBuffer.hxx"
#include "util/StringBuffer.hxx"
+#include "util/RuntimeError.hxx"
#include "system/FatalError.hxx"
#include "Log.hxx"
@@ -53,10 +54,9 @@ load_filter(const char *name)
{
const auto *param = config_find_block(ConfigBlockOption::AUDIO_FILTER,
"name", name);
- if (param == NULL) {
- fprintf(stderr, "No such configured filter: %s\n", name);
- return nullptr;
- }
+ if (param == NULL)
+ throw FormatRuntimeError("No such configured filter: %s",
+ name);
return filter_configured_new(*param);
}
@@ -87,8 +87,6 @@ try {
/* initialize the filter */
auto prepared_filter = load_filter(argv[2]);
- if (!prepared_filter)
- return EXIT_FAILURE;
/* open the filter */