mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-13 18:46:37 +00:00
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:
@@ -129,11 +129,12 @@ def get_auto_update_status():
|
|||||||
try:
|
try:
|
||||||
config = api_v3.config_manager.load_config() if api_v3.config_manager else {}
|
config = api_v3.config_manager.load_config() if api_v3.config_manager else {}
|
||||||
return jsonify({'status': 'success', 'data': auto_update.describe_status(config)})
|
return jsonify({'status': 'success', 'data': auto_update.describe_status(config)})
|
||||||
except Exception:
|
except Exception as e:
|
||||||
# Details stay in the log: exception text can carry file paths.
|
# 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)
|
logger.error("get_auto_update_status failed", exc_info=True)
|
||||||
return jsonify({'status': 'error',
|
return jsonify({'status': 'error', 'message': 'Could not read automatic update status',
|
||||||
'message': 'Could not read automatic update status; see logs for details'}), 500
|
'details': describe_exception(e)}), 500
|
||||||
|
|
||||||
|
|
||||||
@api_v3.route('/system/auto-update/dismiss', methods=['POST'])
|
@api_v3.route('/system/auto-update/dismiss', methods=['POST'])
|
||||||
|
|||||||
Reference in New Issue
Block a user