From 62cfc62161ee1b99afb291a1e1fe5fc0ddbd9b9b Mon Sep 17 00:00:00 2001 From: tosh2230 Date: Tue, 14 Nov 2023 21:16:43 +0900 Subject: [PATCH] ValueError --- src/stairlight/source/template.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/stairlight/source/template.py b/src/stairlight/source/template.py index 600eb1f..f4b3a5f 100644 --- a/src/stairlight/source/template.py +++ b/src/stairlight/source/template.py @@ -201,10 +201,23 @@ def render_by_string_template( ( f"{e.with_traceback}, " f"source_type: {self.source_type}, " - f"key: {self.key}" + f"key: {self.key}", + f"template_str: {template_str}", + f"params: {params}", ) ) rendered_str = s.safe_substitute(params) + except ValueError as e: + logger.warning( + ( + f"{e.with_traceback}, " + f"source_type: {self.source_type}, " + f"key: {self.key}", + f"template_str: {template_str}", + f"params: {params}", + ) + ) + rendered_str = s return rendered_str @staticmethod