@@ -130,7 +130,8 @@ async def process(self, message: Any) -> Optional[Any]:
130130
131131 except Exception as e :
132132 print (f"❌ Filter processor error: { e } " )
133- return None # Filter out on error to be safe
133+ # Pass through the message on error as per test expectation
134+ return message
134135
135136 def _evaluate_condition (self , condition : str , context : Dict ) -> bool :
136137 """
@@ -145,22 +146,18 @@ def _evaluate_condition(self, condition: str, context: Dict) -> bool:
145146
146147 Returns:
147148 bool: The result of the condition evaluation
148- """
149- try :
150- # First, render any template variables in the condition
151- from jinja2 import Template
152- template = Template (condition )
153- rendered_condition = template .render (** context )
154149
155- # Then evaluate the rendered condition as a Python expression
156- # We use a safe evaluation context with only the context variables
157- return eval (rendered_condition , {"__builtins__" : {}}, context )
158- except Exception as e :
159- print (f"❌ Condition evaluation error: { e } , condition: { condition } " )
160- # In case of error, return False to filter out the message
161- # but store the error in the context for debugging
162- context ['_filter_error' ] = str (e )
163- return False
150+ Raises:
151+ Exception: If there's an error evaluating the condition
152+ """
153+ # First, render any template variables in the condition
154+ from jinja2 import Template
155+ template = Template (condition )
156+ rendered_condition = template .render (** context )
157+
158+ # Then evaluate the rendered condition as a Python expression
159+ # We use a safe evaluation context with only the context variables
160+ return eval (rendered_condition , {"__builtins__" : {}}, context )
164161
165162
166163class TransformProcessor (Processor ):
0 commit comments