Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ def test_connection():
success, message = api.test_connection()
print(f"Test connection result: success={success}, message={message}")

if not success:
# Log the detailed error server-side
print(f"Sanitized error: {message}")
Comment on lines +135 to +136
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid printing potentially sensitive error details to stdout and the label 'Sanitized error' is misleading given the raw message is logged. Use the application's logger and redact sensitive values (e.g., tokens, passwords) before logging: replace with something like logger.error('Connection test failed: %s', redact(message)).

Copilot uses AI. Check for mistakes.
# Provide generic error for user
user_message = "Connection test failed. Please check your details and try again or contact support."
return jsonify({'success': False, 'message': user_message})
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On failure, the API should return a non-2xx status code to accurately reflect the error state (e.g., 400 or 502). Suggest returning a tuple with status: return jsonify({'success': False, 'message': user_message}), 400.

Copilot uses AI. Check for mistakes.

result = {
'success': success,
'message': message
Expand Down
Loading