From 68c14d1e5312f873c04f95e1fa35b64a7357a76b Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@musicpd.org>
Date: Fri, 9 Dec 2016 23:50:38 +0100
Subject: [PATCH] test/read_tags: catch exceptions from ScanFile() before
 falling back to ScanStream()

---
 test/read_tags.cxx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/test/read_tags.cxx b/test/read_tags.cxx
index 06598b8a3..1742d3011 100644
--- a/test/read_tags.cxx
+++ b/test/read_tags.cxx
@@ -101,7 +101,14 @@ try {
 		return EXIT_FAILURE;
 	}
 
-	bool success = plugin->ScanFile(path, print_handler, nullptr);
+	bool success;
+	try {
+		success = plugin->ScanFile(path, print_handler, nullptr);
+	} catch (const std::exception &e) {
+		LogError(e);
+		success = false;
+	}
+
 	if (!success && plugin->scan_stream != NULL) {
 		Mutex mutex;
 		Cond cond;