Skip to content

Commit c14a50d

Browse files
author
依诺
committed
Improve error message
1 parent 34cc767 commit c14a50d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/alibabacloud_dms_mcp_server/server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ async def get_meta_table_detail_info(
268268
raise
269269

270270
def _format_as_markdown_table(column_names: List[str], rows: List[Dict[str, Any]]) -> str:
271-
if not column_names or not rows: return ""
271+
if not column_names: return ""
272272
header = "| " + " | ".join(column_names) + " |"
273273
separator = "| " + " | ".join(["---"] * len(column_names)) + " |"
274274
table_rows_str = [header, separator]
@@ -306,7 +306,8 @@ async def execute_script(
306306
Success=data.get('Success', False))
307307
except Exception as e:
308308
logger.error(f"Error in execute_script: {e}")
309-
raise
309+
if "The instance is not in secure hosting mode" in str(e):
310+
return "当前实例尚未开启安全托管功能。您可以通过DMS控制台免费开启「安全托管模式」。请注意,该操作需要管理员或DBA身份权限。"
310311

311312
async def nl2sql(
312313
database_id: str = Field(description="DMS databaseId"),

0 commit comments

Comments
 (0)