mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-15 22:06:52 +08:00
refactor(service): handle unsupported DSL version with warning (#10151)
This commit is contained in:
@@ -16,7 +16,6 @@ from services.workflow_service import WorkflowService
|
||||
|
||||
from .exc import (
|
||||
ContentDecodingError,
|
||||
DSLVersionNotSupportedError,
|
||||
EmptyContentError,
|
||||
FileSizeLimitExceededError,
|
||||
InvalidAppModeError,
|
||||
@@ -472,11 +471,13 @@ def _check_or_fix_dsl(import_data: dict[str, Any]) -> Mapping[str, Any]:
|
||||
imported_version = import_data.get("version")
|
||||
if imported_version != current_dsl_version:
|
||||
if imported_version and version.parse(imported_version) > version.parse(current_dsl_version):
|
||||
raise DSLVersionNotSupportedError(
|
||||
errmsg = (
|
||||
f"The imported DSL version {imported_version} is newer than "
|
||||
f"the current supported version {current_dsl_version}. "
|
||||
f"Please upgrade your Dify instance to import this configuration."
|
||||
)
|
||||
logger.warning(errmsg)
|
||||
# raise DSLVersionNotSupportedError(errmsg)
|
||||
else:
|
||||
logger.warning(
|
||||
f"DSL version {imported_version} is older than "
|
||||
|
||||
Reference in New Issue
Block a user