fix(auto-update): keep error detail in the status route's 500

test_web_error_detail requires every 5xx handler to log the traceback and
return describe_exception(e), which redacts credentials, so failures are
diagnosable from the web UI. Dropping it for CodeQL broke that policy.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Chuck
2026-09-14 18:48:13 -04:00
co-authored by Claude Opus 5
parent abddcc85d8
commit a6790891f9
+5 -4
View File
@@ -129,11 +129,12 @@ def get_auto_update_status():
try:
config = api_v3.config_manager.load_config() if api_v3.config_manager else {}
return jsonify({'status': 'success', 'data': auto_update.describe_status(config)})
except Exception:
# Details stay in the log: exception text can carry file paths.
except Exception as e:
# describe_exception redacts credentials; the detail is kept on purpose
# (see test_web_error_detail.py) so a failure is diagnosable from the UI.
logger.error("get_auto_update_status failed", exc_info=True)
return jsonify({'status': 'error',
'message': 'Could not read automatic update status; see logs for details'}), 500
return jsonify({'status': 'error', 'message': 'Could not read automatic update status',
'details': describe_exception(e)}), 500
@api_v3.route('/system/auto-update/dismiss', methods=['POST'])