From 08f75685fbbcf9398634859e1661c33fdabf6ffa Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 6 May 2024 17:17:58 +0800 Subject: [PATCH] Update index.py --- plugins/mongodb/index.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/mongodb/index.py b/plugins/mongodb/index.py index 4bd4c6b58..f16851303 100755 --- a/plugins/mongodb/index.py +++ b/plugins/mongodb/index.py @@ -432,7 +432,12 @@ def runInfo(): ''' client = mongdbClient() db = client.admin - serverStatus = db.command('serverStatus') + + try: + serverStatus = db.command('serverStatus') + except Exception as e: + return mw.returnJson(False, str(e)) + listDbs = client.list_database_names()