Skip to content

Commit 7627c5a

Browse files
authored
fix crash on TimeParserException during preprocessing caused by inval… (#867)
1 parent 4e41bc1 commit 7627c5a

File tree

27 files changed

+1620
-715
lines changed

27 files changed

+1620
-715
lines changed

logprep/ng/abc/input.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from copy import deepcopy
1313
from functools import cached_property, partial
1414
from hmac import HMAC
15-
from typing import Literal, Optional, Self
15+
from typing import Optional, Self
1616
from zoneinfo import ZoneInfo
1717

1818
from attrs import define, field, validators
@@ -26,7 +26,7 @@
2626
from logprep.ng.event.set_event_backlog import SetEventBacklog
2727
from logprep.processor.base.exceptions import FieldExistsWarning
2828
from logprep.util.helper import add_fields_to, get_dotted_field_value
29-
from logprep.util.time import UTC, TimeParser
29+
from logprep.util.time import UTC, TimeParser, TimeParserException
3030
from logprep.util.validators import dict_structure_validator
3131

3232

@@ -454,7 +454,7 @@ def get_next(self, timeout: float) -> LogEvent | None:
454454
self._add_arrival_timedelta_information_to_event(event)
455455
if self._add_env_enrichment:
456456
self._add_env_enrichment_to_event(event)
457-
except FieldExistsWarning as error:
457+
except (FieldExistsWarning, TimeParserException) as error:
458458
raise CriticalInputError(self, error.args[0], event) from error
459459
except CriticalInputError as error:
460460
self._register_failed_event(

logprep/ng/connector/confluent_kafka/input.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from functools import cached_property, partial
3333
from socket import getfqdn
3434
from types import MappingProxyType
35-
from typing import Any, Literal, Optional, Union
35+
from typing import Any, Optional, Union
3636

3737
import msgspec
3838
from attrs import define, field, validators

0 commit comments

Comments
 (0)