fix: Added Try Except to Filter Handling (#9183)

* Added Try Except to Filter Handling

* Avoid Redundant Error Processing
This commit is contained in:
Cooper
2026-07-09 15:48:52 +08:00
committed by GitHub
parent afb898e61f
commit 12f2f5a09c

View File

@@ -243,7 +243,13 @@ class ResultDecorateStage(Stage):
continue
for seg in split_response:
if self.content_cleanup_rule:
seg = re.sub(self.content_cleanup_rule, "", seg)
try:
seg = re.sub(self.content_cleanup_rule, "", seg)
except re.error:
logger.error(
f"分段回复过滤表达式失败,无法成功过滤:{traceback.format_exc()}"
)
self.content_cleanup_rule = None
seg = seg.strip()
if seg:
new_chain.append(Plain(seg))