input/Plugin: migrate open() from class Error to C++ exceptions

This commit is contained in:
Max Kellermann
2016-09-09 15:37:06 +02:00
parent 63ab7767a3
commit fc7d3f64c0
44 changed files with 359 additions and 461 deletions

View File

@@ -30,6 +30,8 @@
#include "input/LocalOpen.hxx"
#include "thread/Cond.hxx"
#include <stdexcept>
#include <assert.h>
class TagFileScan {
@@ -60,11 +62,12 @@ public:
/* open the InputStream (if not already open) */
if (is == nullptr) {
is = OpenLocalInputStream(path_fs,
mutex, cond,
IgnoreError());
if (is == nullptr)
try {
is = OpenLocalInputStream(path_fs,
mutex, cond);
} catch (const std::runtime_error &) {
return false;
}
} else
is->LockRewind(IgnoreError());