summaryrefslogtreecommitdiff
path: root/test/visit_archive.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-09-09 18:34:55 +0200
committerMax Kellermann <max@musicpd.org>2016-09-09 18:36:36 +0200
commit220d9528a3251aaeb789e75d4f649ac04b9a9001 (patch)
tree8bdca00f6546e18fad1f79acf259c26b94fd5463 /test/visit_archive.cxx
parentfc7d3f64c007672e4c01172ccb1c46d083a8abd5 (diff)
archive/Plugin: migrate open() from class Error to C++ exceptions
Diffstat (limited to 'test/visit_archive.cxx')
-rw-r--r--test/visit_archive.cxx17
1 files changed, 5 insertions, 12 deletions
diff --git a/test/visit_archive.cxx b/test/visit_archive.cxx
index 96c2eb9d2..28d5dda35 100644
--- a/test/visit_archive.cxx
+++ b/test/visit_archive.cxx
@@ -27,7 +27,6 @@
#include "archive/ArchiveFile.hxx"
#include "archive/ArchiveVisitor.hxx"
#include "fs/Path.hxx"
-#include "util/Error.hxx"
#include "Log.hxx"
#include <stdexcept>
@@ -46,8 +45,6 @@ class MyArchiveVisitor final : public ArchiveVisitor {
int
main(int argc, char **argv)
try {
- Error error;
-
if (argc != 3) {
fprintf(stderr, "Usage: visit_archive PLUGIN PATH\n");
return EXIT_FAILURE;
@@ -76,15 +73,11 @@ try {
int result = EXIT_SUCCESS;
- ArchiveFile *file = archive_file_open(plugin, path, error);
- if (file != nullptr) {
- MyArchiveVisitor visitor;
- file->Visit(visitor);
- file->Close();
- } else {
- fprintf(stderr, "%s", error.GetMessage());
- result = EXIT_FAILURE;
- }
+ ArchiveFile *file = archive_file_open(plugin, path);
+
+ MyArchiveVisitor visitor;
+ file->Visit(visitor);
+ file->Close();
/* deinitialize everything */