test/run_filter: throw exception on error
This commit is contained in:
parent
edef62df86
commit
a2c2288cd6
@ -29,6 +29,7 @@
|
|||||||
#include "mixer/MixerControl.hxx"
|
#include "mixer/MixerControl.hxx"
|
||||||
#include "util/ConstBuffer.hxx"
|
#include "util/ConstBuffer.hxx"
|
||||||
#include "util/StringBuffer.hxx"
|
#include "util/StringBuffer.hxx"
|
||||||
|
#include "util/RuntimeError.hxx"
|
||||||
#include "system/FatalError.hxx"
|
#include "system/FatalError.hxx"
|
||||||
#include "Log.hxx"
|
#include "Log.hxx"
|
||||||
|
|
||||||
@ -53,10 +54,9 @@ load_filter(const char *name)
|
|||||||
{
|
{
|
||||||
const auto *param = config_find_block(ConfigBlockOption::AUDIO_FILTER,
|
const auto *param = config_find_block(ConfigBlockOption::AUDIO_FILTER,
|
||||||
"name", name);
|
"name", name);
|
||||||
if (param == NULL) {
|
if (param == NULL)
|
||||||
fprintf(stderr, "No such configured filter: %s\n", name);
|
throw FormatRuntimeError("No such configured filter: %s",
|
||||||
return nullptr;
|
name);
|
||||||
}
|
|
||||||
|
|
||||||
return filter_configured_new(*param);
|
return filter_configured_new(*param);
|
||||||
}
|
}
|
||||||
@ -87,8 +87,6 @@ try {
|
|||||||
/* initialize the filter */
|
/* initialize the filter */
|
||||||
|
|
||||||
auto prepared_filter = load_filter(argv[2]);
|
auto prepared_filter = load_filter(argv[2]);
|
||||||
if (!prepared_filter)
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
|
|
||||||
/* open the filter */
|
/* open the filter */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user