summaryrefslogtreecommitdiff
path: root/src/tag
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-01-18 19:50:02 +0100
committerMax Kellermann <max@musicpd.org>2020-01-18 19:50:02 +0100
commit526c778162ab008c34c5fc319c18be6d3b54466e (patch)
tree83937c8659907175a7016f5f76994a09f92d81b7 /src/tag
parente01bddbd86013dc851c50b184685706e63e1c80e (diff)
tag/Id3Scan: remove exception handler, let caller catch
There's just one caller, i.e. ScanGenericTags(), which is documented to throw exceptions.
Diffstat (limited to 'src/tag')
-rw-r--r--src/tag/Id3Scan.cxx16
-rw-r--r--src/tag/Id3Scan.hxx5
2 files changed, 7 insertions, 14 deletions
diff --git a/src/tag/Id3Scan.cxx b/src/tag/Id3Scan.cxx
index c85de6b70..2ae21dc10 100644
--- a/src/tag/Id3Scan.cxx
+++ b/src/tag/Id3Scan.cxx
@@ -28,12 +28,9 @@
#include "util/ScopeExit.hxx"
#include "util/StringStrip.hxx"
#include "util/StringView.hxx"
-#include "Log.hxx"
#include <id3tag.h>
-#include <exception>
-
#include <string.h>
#include <stdlib.h>
@@ -381,18 +378,11 @@ tag_id3_import(const struct id3_tag *tag) noexcept
}
bool
-tag_id3_scan(InputStream &is, TagHandler &handler) noexcept
+tag_id3_scan(InputStream &is, TagHandler &handler)
{
- UniqueId3Tag tag;
-
- try {
- tag = tag_id3_load(is);
- if (!tag)
- return false;
- } catch (...) {
- LogError(std::current_exception());
+ auto tag = tag_id3_load(is);
+ if (!tag)
return false;
- }
scan_id3_tag(tag.get(), handler);
return true;
diff --git a/src/tag/Id3Scan.hxx b/src/tag/Id3Scan.hxx
index b5ba43863..a7bb75682 100644
--- a/src/tag/Id3Scan.hxx
+++ b/src/tag/Id3Scan.hxx
@@ -25,8 +25,11 @@ class TagHandler;
struct Tag;
struct id3_tag;
+/**
+ * Throws on I/O error.
+ */
bool
-tag_id3_scan(InputStream &is, TagHandler &handler) noexcept;
+tag_id3_scan(InputStream &is, TagHandler &handler);
Tag
tag_id3_import(const struct id3_tag *) noexcept;