From 90076e3a777576a482f37db6f67331ffcd2783fb Mon Sep 17 00:00:00 2001
From: rabbitali <wenxin32@foxmail.com>
Date: Wed, 27 Dec 2023 10:35:35 +0800
Subject: [PATCH] update the exception catching type of the function

---
 zeus/vulnerability_manage/view.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/zeus/vulnerability_manage/view.py b/zeus/vulnerability_manage/view.py
index 37ab633..0a3537a 100644
--- a/zeus/vulnerability_manage/view.py
+++ b/zeus/vulnerability_manage/view.py
@@ -19,6 +19,7 @@ from flask import Response, request
 import sqlalchemy
 import gevent
 
+from vulcanus.exceptions import DatabaseConnectionFailed
 from vulcanus.log.log import LOGGER
 from vulcanus.restful.resp import state
 from vulcanus.restful.response import BaseResponse
@@ -70,7 +71,7 @@ def query_host_basic_info(host_list: list, username: str) -> Tuple[str, Dict]:
     try:
         with HostProxy() as proxy:
             status_code, host_infos = proxy.get_host_info({"host_list": host_list, "username": username})
-    except sqlalchemy.exc.SQLAlchemyError:
+    except DatabaseConnectionFailed:
         LOGGER.error("Connect to database error")
         return state.DATABASE_CONNECT_ERROR, dict()
 
-- 
2.33.0

