fix(scanner): don't perform potentially throwing operations in debug mode

This commit is contained in:
Marcus Holland-Moritz 2024-07-31 18:54:57 +02:00
parent bc7a3c1f31
commit bbd8306a13

View File

@ -369,7 +369,8 @@ scanner_<LoggerPolicy>::add_entry(std::filesystem::path const& name,
if (pe) { if (pe) {
switch (pe->type()) { switch (pe->type()) {
case entry::E_FILE: case entry::E_FILE:
if (pe->size() > 0 && os_.access(pe->fs_path(), R_OK)) { if (!debug_filter && pe->size() > 0 &&
os_.access(pe->fs_path(), R_OK)) {
LOG_ERROR << "cannot access " << pe->path_as_string() LOG_ERROR << "cannot access " << pe->path_as_string()
<< ", creating empty file"; << ", creating empty file";
pe->override_size(0); pe->override_size(0);