Commit 526c7781 authored by Max Kellermann's avatar Max Kellermann

tag/Id3Scan: remove exception handler, let caller catch

There's just one caller, i.e. ScanGenericTags(), which is documented to throw exceptions.
parent e01bddbd
...@@ -28,12 +28,9 @@ ...@@ -28,12 +28,9 @@
#include "util/ScopeExit.hxx" #include "util/ScopeExit.hxx"
#include "util/StringStrip.hxx" #include "util/StringStrip.hxx"
#include "util/StringView.hxx" #include "util/StringView.hxx"
#include "Log.hxx"
#include <id3tag.h> #include <id3tag.h>
#include <exception>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -381,18 +378,11 @@ tag_id3_import(const struct id3_tag *tag) noexcept ...@@ -381,18 +378,11 @@ tag_id3_import(const struct id3_tag *tag) noexcept
} }
bool bool
tag_id3_scan(InputStream &is, TagHandler &handler) noexcept tag_id3_scan(InputStream &is, TagHandler &handler)
{ {
UniqueId3Tag tag; auto tag = tag_id3_load(is);
try {
tag = tag_id3_load(is);
if (!tag) if (!tag)
return false; return false;
} catch (...) {
LogError(std::current_exception());
return false;
}
scan_id3_tag(tag.get(), handler); scan_id3_tag(tag.get(), handler);
return true; return true;
......
...@@ -25,8 +25,11 @@ class TagHandler; ...@@ -25,8 +25,11 @@ class TagHandler;
struct Tag; struct Tag;
struct id3_tag; struct id3_tag;
/**
* Throws on I/O error.
*/
bool bool
tag_id3_scan(InputStream &is, TagHandler &handler) noexcept; tag_id3_scan(InputStream &is, TagHandler &handler);
Tag Tag
tag_id3_import(const struct id3_tag *) noexcept; tag_id3_import(const struct id3_tag *) noexcept;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment