summaryrefslogtreecommitdiff
path: root/test/run_gzip.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-07-17 21:56:43 +0200
committerMax Kellermann <max@musicpd.org>2018-07-17 21:58:39 +0200
commitd6529d8c6005e42c69a9402b31ddcd9f4be4cfa6 (patch)
treeb98690cc13e49bff6a58b0e5a754e17ac056e9b8 /test/run_gzip.cxx
parentedb44a536a726e6889f02ee26fb393432152ae7b (diff)
test/*: catch and print all exceptions
Diffstat (limited to 'test/run_gzip.cxx')
-rw-r--r--test/run_gzip.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/test/run_gzip.cxx b/test/run_gzip.cxx
index c018c3167..f305ba844 100644
--- a/test/run_gzip.cxx
+++ b/test/run_gzip.cxx
@@ -21,7 +21,7 @@
#include "fs/io/GzipOutputStream.hxx"
#include "fs/io/StdioOutputStream.hxx"
#include "system/Error.hxx"
-#include "Log.hxx"
+#include "util/PrintException.hxx"
#include <stdio.h>
#include <stdlib.h>
@@ -61,17 +61,15 @@ CopyGzip(FILE *_dest, int src)
int
main(int argc, gcc_unused char **argv)
-{
+try {
if (argc != 1) {
fprintf(stderr, "Usage: run_gzip\n");
return EXIT_FAILURE;
}
- try {
- CopyGzip(stdout, STDIN_FILENO);
- return EXIT_SUCCESS;
- } catch (const std::exception &e) {
- LogError(e);
- return EXIT_FAILURE;
- }
+ CopyGzip(stdout, STDIN_FILENO);
+ return EXIT_SUCCESS;
+} catch (...) {
+ PrintException(std::current_exception());
+ return EXIT_FAILURE;
}