fix: db.connect() возвращает ошибку, /test показывает детали
This commit is contained in:
+4
-4
@@ -10,9 +10,9 @@ def test():
|
||||
|
||||
# GET — статус
|
||||
if request.method == "GET":
|
||||
conn = db.connect()
|
||||
conn, err = db.connect()
|
||||
return jsonify({
|
||||
"db": "ok" if conn else "fail",
|
||||
"db": "ok" if conn else f"fail: {err}",
|
||||
"actions": [
|
||||
"GET /test — статус БД",
|
||||
"POST /test SQL:... — выполнить запрос",
|
||||
@@ -25,8 +25,8 @@ def test():
|
||||
action = data.get("action", "status")
|
||||
|
||||
if action == "status":
|
||||
conn = db.connect()
|
||||
return jsonify({"db": "ok" if conn else "fail"})
|
||||
conn, err = db.connect()
|
||||
return jsonify({"db": "ok" if conn else f"fail: {err}"})
|
||||
|
||||
if action == "tables":
|
||||
result, err = db.query(
|
||||
|
||||
Reference in New Issue
Block a user