diff options
author | Max Kellermann <max@duempel.org> | 2016-07-11 22:37:40 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2016-07-11 22:37:40 +0200 |
commit | c5fb56f90f73fcdf3ab8d2eb560894150da68e55 (patch) | |
tree | 54031c6c82cf4c3523daddbcadfba270ccf6fd20 | |
parent | b67e7df38e852f6008a6cb26abcf149faa5e837a (diff) |
test/run_decoder: catch and print C++ exceptions
-rw-r--r-- | test/run_decoder.cxx | 9 |
1 files 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 <stdexcept> + #include <assert.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> 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; } |