Skip to content

Commit f5e0452

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

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,13 +534,14 @@ def test_backup_with_context():
534534
return f"Repository {repository.id} not found or inactive"
535535
except Exception as e:
536536
logger.error(f"Error in test backup for repository {repository.id}: {e}")
537-
return f"Error: {str(e)}"
537+
return "An internal error occurred"
538538

539539
try:
540540
result = test_backup_with_context()
541541
return jsonify({'success': True, 'message': result})
542542
except Exception as e:
543-
return jsonify({'success': False, 'error': str(e)}), 500
543+
logger.error(f"Error in /api/test-backup/{repo_id}: {e}")
544+
return jsonify({'success': False, 'error': 'Internal server error'}), 500
544545

545546
@app.route('/api/theme', methods=['POST'])
546547
@login_required

0 commit comments

Comments
 (0)