From 29fb3cf62bd8d87479dfffbb83e5e1f8d5026fc1 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Wed, 31 Dec 2025 18:34:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20[Application]=20The=20AI=20=E2=80=8B?= =?UTF-8?q?=E2=80=8Bnode=20handled=20the=20exception=20using=20the=20excep?= =?UTF-8?q?tion=20handling=20branch,=20but=20the=20AI=20=E2=80=8B=E2=80=8B?= =?UTF-8?q?node=20still=20output=20the=20exception=20information.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/application/flow/workflow_manage.py | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/application/flow/workflow_manage.py b/apps/application/flow/workflow_manage.py index b10e5c5973d..da43c6a9128 100644 --- a/apps/application/flow/workflow_manage.py +++ b/apps/application/flow/workflow_manage.py @@ -484,21 +484,21 @@ def hand_event_node_result(self, current_node, node_result_future): return current_result except Exception as e: # 添加节点 - maxkb_logger.error(f'Exception: {e}', exc_info=True) - chunk = self.base_to_response.to_stream_chunk_response(self.params.get('chat_id'), - self.params.get('chat_id'), - current_node.id, - current_node.up_node_id_list, - 'Exception:' + str(e), False, 0, 0, - {'node_is_end': True, - 'runtime_node_id': current_node.runtime_node_id, - 'node_type': current_node.type, - 'view_type': current_node.view_type, - 'child_node': {}, - 'real_node_id': real_node_id, - 'node_status': 'ERROR'}) - current_node.node_chunk.add_chunk(chunk) + if not current_node.node.properties.get('enableException'): + chunk = self.base_to_response.to_stream_chunk_response(self.params.get('chat_id'), + self.params.get('chat_id'), + current_node.id, + current_node.up_node_id_list, + 'Exception:' + str(e), False, 0, 0, + {'node_is_end': True, + 'runtime_node_id': current_node.runtime_node_id, + 'node_type': current_node.type, + 'view_type': current_node.view_type, + 'child_node': {}, + 'real_node_id': real_node_id, + 'node_status': 'ERROR'}) + current_node.node_chunk.add_chunk(chunk) current_node.get_write_error_context(e) self.status = 500 current_node.context['exception_message'] = current_node.err_message