file db unit tests and fixes
This commit is contained in:
parent
8c8d7b3bf9
commit
c9ac60a2fc
@ -533,10 +533,16 @@ auto encrypt_provider::is_directory(const std::string &api_path,
|
||||
try {
|
||||
std::string source_path;
|
||||
auto result = db_->get_directory_source_path(api_path, source_path);
|
||||
|
||||
if (result != api_error::success) {
|
||||
if (result != api_error::directory_not_found) {
|
||||
return result;
|
||||
}
|
||||
|
||||
exists = false;
|
||||
return api_error::success;
|
||||
}
|
||||
|
||||
exists = utils::file::directory{source_path}.exists();
|
||||
return api_error::success;
|
||||
} catch (const std::exception &ex) {
|
||||
@ -555,9 +561,14 @@ auto encrypt_provider::is_file(const std::string &api_path, bool &exists) const
|
||||
std::string source_path;
|
||||
auto result = db_->get_file_source_path(api_path, source_path);
|
||||
if (result != api_error::success) {
|
||||
if (result != api_error::item_not_found) {
|
||||
return result;
|
||||
}
|
||||
|
||||
exists = false;
|
||||
return api_error::success;
|
||||
}
|
||||
|
||||
exists = utils::file::file{source_path}.exists();
|
||||
return api_error::success;
|
||||
} catch (const std::exception &ex) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user