summaryrefslogtreecommitdiff
path: root/test/run_input.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-09-05 12:05:54 +0200
committerMax Kellermann <max@musicpd.org>2016-09-09 15:16:47 +0200
commit6ed77f2a27c332218a7144606af90404ba433397 (patch)
tree7956e951258cbeff5e410dae5bc8689c50ca3304 /test/run_input.cxx
parenta73688a2be74ee6b5e68bfafa8d84e6cfe00bf5d (diff)
input/Plugin: migrate init() from class Error to C++ exceptions
Diffstat (limited to 'test/run_input.cxx')
-rw-r--r--test/run_input.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/run_input.cxx b/test/run_input.cxx
index 757895124..726758506 100644
--- a/test/run_input.cxx
+++ b/test/run_input.cxx
@@ -34,6 +34,8 @@
#include "archive/ArchiveList.hxx"
#endif
+#include <stdexcept>
+
#include <unistd.h>
#include <stdlib.h>
@@ -91,7 +93,7 @@ dump_input_stream(InputStream *is)
}
int main(int argc, char **argv)
-{
+try {
if (argc != 2) {
fprintf(stderr, "Usage: run_input URI\n");
return EXIT_FAILURE;
@@ -108,10 +110,7 @@ int main(int argc, char **argv)
#endif
Error error;
- if (!input_stream_global_init(error)) {
- LogError(error);
- return 2;
- }
+ input_stream_global_init();
/* open the stream and dump it */
@@ -142,4 +141,7 @@ int main(int argc, char **argv)
config_global_finish();
return ret;
+} catch (const std::exception &e) {
+ LogError(e);
+ return EXIT_FAILURE;
}