From dc59f24ce2a69631e9fa00b3ebeeca5c9d88a435 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 6 May 2024 17:17:36 +0800 Subject: [PATCH] Update index.py --- plugins/mongodb/index.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/mongodb/index.py b/plugins/mongodb/index.py index f5bd49432..4bd4c6b58 100755 --- a/plugins/mongodb/index.py +++ b/plugins/mongodb/index.py @@ -482,7 +482,11 @@ def runDocInfo(): def runReplInfo(): client = mongdbClient() db = client.admin - serverStatus = db.command('serverStatus') + + try: + serverStatus = db.command('serverStatus') + except Exception as e: + return mw.returnJson(False, str(e)) d = getConfigData() result = {}