diff options
author | Max Kellermann <max@musicpd.org> | 2016-09-09 15:37:06 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2016-09-09 18:15:01 +0200 |
commit | fc7d3f64c007672e4c01172ccb1c46d083a8abd5 (patch) | |
tree | 3c72f16ee6cc919a17558678a1e270568182b8af /src/TagArchive.cxx | |
parent | 63ab7767a37a99b5651f32e067aeb5fcbb7bd033 (diff) |
input/Plugin: migrate open() from class Error to C++ exceptions
Diffstat (limited to 'src/TagArchive.cxx')
-rw-r--r-- | src/TagArchive.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/TagArchive.cxx b/src/TagArchive.cxx index a5a849d7b..dd1b73a38 100644 --- a/src/TagArchive.cxx +++ b/src/TagArchive.cxx @@ -28,26 +28,28 @@ bool tag_archive_scan(ArchiveFile &archive, const char *path_utf8, const TagHandler &handler, void *handler_ctx) -{ +try { Mutex mutex; Cond cond; - InputStreamPtr is(archive.OpenStream(path_utf8, mutex, cond, - IgnoreError())); + InputStreamPtr is(archive.OpenStream(path_utf8, mutex, cond)); if (!is) return false; return tag_stream_scan(*is, handler, handler_ctx); +} catch (const std::exception &e) { + return false; } bool tag_archive_scan(ArchiveFile &archive, const char *path_utf8, TagBuilder &builder) -{ +try { Mutex mutex; Cond cond; - InputStreamPtr is(archive.OpenStream(path_utf8, mutex, cond, - IgnoreError())); + InputStreamPtr is(archive.OpenStream(path_utf8, mutex, cond)); return is && tag_stream_scan(*is, builder); +} catch (const std::exception &e) { + return false; } |