Skip to content

Commit 63c7bdb

Browse files
Potential fix for code scanning alert no. 20: Information exposure through an exception
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 4e5ebb2 commit 63c7bdb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/flask/routes/users.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ def update_user(user_id):
132132
}), 200
133133

134134
except Exception as e:
135-
return jsonify({"error": f"Database error: {str(e)}"}), 500
135+
logging.error(f"Database error in update_user: {e}", exc_info=True)
136+
return jsonify({"error": "Database error"}), 500
136137

137138

138139
@bp.route("/<user_id>", methods=["DELETE"])

0 commit comments

Comments
 (0)