From c9f94cd346950b59c115bfc793386d512485a4eb Mon Sep 17 00:00:00 2001 From: speedplane Date: Wed, 7 May 2025 15:28:05 -0400 Subject: [PATCH] Catch value errors, which can occur if the logs have uneven brackets, due to unescaped input. --- seqlog/structured_logging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seqlog/structured_logging.py b/seqlog/structured_logging.py index c6596ac..3e091bb 100644 --- a/seqlog/structured_logging.py +++ b/seqlog/structured_logging.py @@ -158,7 +158,7 @@ def getMessage(self): elif self.log_props: try: return self.msg.format(**self.log_props) - except (KeyError, IndexError): + except (KeyError, IndexError, ValueError): # IndexError because sometimes the wrong log messages go like {existing_prop[0]} return self.msg # handle the situation where we have braces in the logging value else: