From c5fb56f90f73fcdf3ab8d2eb560894150da68e55 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 11 Jul 2016 22:37:40 +0200 Subject: [PATCH] test/run_decoder: catch and print C++ exceptions --- test/run_decoder.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/run_decoder.cxx b/test/run_decoder.cxx index 7035b841e..1d689a3d2 100644 --- a/test/run_decoder.cxx +++ b/test/run_decoder.cxx @@ -29,13 +29,15 @@ #include "util/Error.hxx" #include "Log.hxx" +#include + #include #include #include #include int main(int argc, char **argv) -{ +try { if (argc != 3) { fprintf(stderr, "Usage: run_decoder DECODER URI >OUT\n"); return EXIT_FAILURE; @@ -89,5 +91,8 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - return 0; + return EXIT_SUCCESS; +} catch (const std::exception &e) { + LogError(e); + return EXIT_FAILURE; }