Log and Continue on OSError while collating dates for date filters

Log to understand if error, date can be handled better
Mitigates #172
This commit is contained in:
Debanjum Singh Solanky 2023-03-01 00:50:51 -06:00
parent 2bed4c3b50
commit 7ad251b8ef

View file

@ -41,6 +41,9 @@ class DateFilter(BaseFilter):
date_in_entry = datetime.strptime(date_in_entry_string, "%Y-%m-%d").timestamp() date_in_entry = datetime.strptime(date_in_entry_string, "%Y-%m-%d").timestamp()
except ValueError: except ValueError:
continue continue
except OSError:
logger.debug(f"OSError: Ignoring unprocessable date in entry: {date_in_entry_string}")
continue
self.date_to_entry_ids[date_in_entry].add(id) self.date_to_entry_ids[date_in_entry].add(id)
def can_filter(self, raw_query): def can_filter(self, raw_query):