Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ def is_valid(self, *, raise_exception=False):
# 归还链接到连接池
connection.close()
if f_lib is None:
raise Exception(_("The function has been deleted"))
raise AppApiException(500, _("Tool has been deleted"))
if not f_lib.is_active:
raise AppApiException(500, _("Tool is not active"))


def get_field_value(debug_field_list, name, is_required):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from application.workflow.message.struct.content import Position
from application.workflow.status import Status
from common.database_model_manage.database_model_manage import DatabaseModelManage
from common.exception.app_exception import ChatException
from common.exception.app_exception import ChatException, AppApiException
from common.field.common import ObjectField
from tools.models import Tool, ToolType, ToolWorkflowVersion

Expand All @@ -43,7 +43,9 @@ def is_valid(self, *, raise_exception=False):
# 归还链接到连接池
connection.close()
if f_lib is None:
raise Exception(_("The function has been deleted"))
raise AppApiException(500, _("Tool has been deleted"))
if not f_lib.is_active:
raise AppApiException(500, _("Tool is not active"))


def valid_function(tool_lib, workspace_id):
Expand Down
Loading