diff --git a/src/TagFile.cxx b/src/TagFile.cxx index f30037481..446f63c0b 100644 --- a/src/TagFile.cxx +++ b/src/TagFile.cxx @@ -51,36 +51,29 @@ public: return plugin.ScanFile(path_fs, handler); } - bool ScanStream(const DecoderPlugin &plugin) noexcept { + bool ScanStream(const DecoderPlugin &plugin) { if (plugin.scan_stream == nullptr) return false; /* open the InputStream (if not already open) */ if (is == nullptr) { - try { - is = OpenLocalInputStream(path_fs, mutex); - } catch (...) { - return false; - } + is = OpenLocalInputStream(path_fs, mutex); } else { - try { - is->LockRewind(); - } catch (...) { - } + is->LockRewind(); } /* now try the stream_tag() method */ return plugin.ScanStream(*is, handler); } - bool Scan(const DecoderPlugin &plugin) noexcept { + bool Scan(const DecoderPlugin &plugin) { return plugin.SupportsSuffix(suffix) && (ScanFile(plugin) || ScanStream(plugin)); } }; bool -ScanFileTagsNoGeneric(Path path_fs, TagHandler &handler) noexcept +ScanFileTagsNoGeneric(Path path_fs, TagHandler &handler) { assert(!path_fs.IsNull()); @@ -100,7 +93,7 @@ ScanFileTagsNoGeneric(Path path_fs, TagHandler &handler) noexcept bool ScanFileTagsWithGeneric(Path path, TagBuilder &builder, - AudioFormat *audio_format) noexcept + AudioFormat *audio_format) { FullTagHandler h(builder, audio_format); diff --git a/src/TagFile.hxx b/src/TagFile.hxx index 691c3569b..6d8351b7b 100644 --- a/src/TagFile.hxx +++ b/src/TagFile.hxx @@ -30,22 +30,26 @@ class TagBuilder; * but does not fall back to generic scanners (APE and ID3) if no tags * were found (but the file was recognized). * + * Throws on error. + * * @return true if the file was recognized (even if no metadata was * found) */ bool -ScanFileTagsNoGeneric(Path path, TagHandler &handler) noexcept; +ScanFileTagsNoGeneric(Path path, TagHandler &handler); /** * Scan the tags of a song file. Invokes matching decoder plugins, * and falls back to generic scanners (APE and ID3) if no tags were * found (but the file was recognized). * + * Throws on error. + * * @return true if the file was recognized (even if no metadata was * found) */ bool ScanFileTagsWithGeneric(Path path, TagBuilder &builder, - AudioFormat *audio_format=nullptr) noexcept; + AudioFormat *audio_format=nullptr); #endif