From 7ad251b8ef1392202e11f65a50c94d36ea156932 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 1 Mar 2023 00:50:51 -0600 Subject: [PATCH] Log and Continue on OSError while collating dates for date filters Log to understand if error, date can be handled better Mitigates #172 --- src/khoj/search_filter/date_filter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/khoj/search_filter/date_filter.py b/src/khoj/search_filter/date_filter.py index 22bfda3f..e91a0beb 100644 --- a/src/khoj/search_filter/date_filter.py +++ b/src/khoj/search_filter/date_filter.py @@ -41,6 +41,9 @@ class DateFilter(BaseFilter): date_in_entry = datetime.strptime(date_in_entry_string, "%Y-%m-%d").timestamp() except ValueError: 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) def can_filter(self, raw_query):