mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-06-29 23:38:38 +00:00
fix(tools,api): address three additional review findings
- api_v3.py install_plugin_requirements: replace hardcoded plugin-repos fallback with config-driven resolution (plugin_system.plugins_directory), matching the pattern used elsewhere in the module - api_v3.py _fix_json_arrays: recurse into converted and existing array elements when items.type is object, so nested numeric-keyed dicts inside array items are also normalized - tools.html toolsAction: check r.ok before r.json() and recover gracefully from non-JSON error bodies (HTML 500 pages), consistent with the existing loadGitInfo guard Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -229,7 +229,14 @@
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({action})
|
||||
})
|
||||
.then(r => r.json())
|
||||
.then(r => {
|
||||
if (!r.ok) {
|
||||
return r.json()
|
||||
.then(d => Promise.reject(new Error(d.message || `HTTP ${r.status}`)))
|
||||
.catch(() => Promise.reject(new Error(`HTTP ${r.status}`)));
|
||||
}
|
||||
return r.json();
|
||||
})
|
||||
.then(data => {
|
||||
const ok = data.status === 'success';
|
||||
showResult(
|
||||
|
||||
Reference in New Issue
Block a user