Skip to content

Commit

Permalink
Improve error messages on scan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
KarlStraussberger committed Oct 6, 2023
1 parent 5aef816 commit 60ce3fc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/content/autoscan_inotify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ void AutoscanInotify::monitorUnmonitorRecursive(const fs::directory_entry& start
}

if (ec) {
log_error("monitorUnmonitorRecursive: Failed to read {}, {}", dirEnt.path().c_str(), ec.message());
log_error("AutoscanInotify::monitorUnmonitorRecursive {}: Failed to read {}, {}", startPath.path().c_str(), dirEnt.path().c_str(), ec.message());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/content/content_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ void ContentManager::_rescanDirectory(const std::shared_ptr<AutoscanDirectory>&
}
}
if (ec) {
log_error("_rescanDirectory: Failed to read {}, {}", newPath.c_str(), ec.message());
log_error("ContentManager::_rescanDirectory {}: Failed to read {}, {}", location.c_str(), newPath.c_str(), ec.message());
}
} // dIter

Expand Down
4 changes: 3 additions & 1 deletion src/content/import_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,11 @@ void ImportService::readDir(const fs::path& location, AutoScanSetting& settings)
readDir(entryPath, settings);
} else {
contentStateCache[entryPath]->setObject(ImportState::Broken, nullptr);
log_error("ImportService::readDir {}: Failed to read {}, {}", location.c_str(), entryPath.c_str(), ec.message());
}
} else if (ec) {
contentStateCache[entryPath]->setObject(ImportState::Broken, nullptr);
log_error("ImportService::readDir {}: Failed to read {}, {}", location.c_str(), entryPath.c_str(), ec.message());
}
}
log_debug("end {}", location.string());
Expand All @@ -282,7 +284,7 @@ void ImportService::readFile(const fs::path& location)
dirEntry.assign(entryPath.parent_path(), ec);
if (ec) {
contentStateCache[entryPath]->setObject(ImportState::Broken, nullptr);
log_error("Failed to navigate up {}, {}", entryPath.c_str(), ec.message());
log_error("ImportService::readFile {}: Failed to navigate up {}, {}", location.c_str(), entryPath.c_str(), ec.message());
break;
}
entryPath = dirEntry.path();
Expand Down

0 comments on commit 60ce3fc

Please sign in to comment.