input/Plugin: migrate open() from class Error to C++ exceptions
This commit is contained in:
		@@ -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());
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user