mirror of
https://github.com/langgenius/dify.git
synced 2026-04-05 10:12:43 +08:00
feat(api): Implement EventManager error logging and add coverage (#29204)
- Ensure `EventManager._notify_layers` logs exceptions instead of silently swallowing them so GraphEngine layer failures surface for debugging - Introduce unit tests to assert the logger captures the runtime error when collecting events - Enable the `S110` lint rule to catch `try-except-pass` patterns - Add proper error logging for existing `try-except-pass` blocks.
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
import logging
|
||||
|
||||
from core.tools.tool_manager import ToolManager
|
||||
from core.tools.utils.configuration import ToolParameterConfigurationManager
|
||||
from core.workflow.nodes import NodeType
|
||||
from core.workflow.nodes.tool.entities import ToolEntity
|
||||
from events.app_event import app_draft_workflow_was_synced
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@app_draft_workflow_was_synced.connect
|
||||
def handle(sender, **kwargs):
|
||||
@@ -30,6 +34,10 @@ def handle(sender, **kwargs):
|
||||
identity_id=f"WORKFLOW.{app.id}.{node_data.get('id')}",
|
||||
)
|
||||
manager.delete_tool_parameters_cache()
|
||||
except:
|
||||
except Exception:
|
||||
# tool dose not exist
|
||||
pass
|
||||
logger.exception(
|
||||
"Failed to delete tool parameters cache for workflow %s node %s",
|
||||
app.id,
|
||||
node_data.get("id"),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user