Skip to content

Commit 479ec12

Browse files
yasinBursaliclaude
andcommitted
fix(dashboard): surface JSON parse errors in TemplatePicker handleApply
The silent .catch(() => ({})) swallowed malformed server responses and fabricated an empty data object, showing a fake 'already active' UI state when the backend actually returned something unparseable. Drop the inline .catch so res.json() failures propagate to the existing outer try/catch, which surfaces a user-visible 'Failed to apply template' error via setError. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ccca57d commit 479ec12

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

dream-server/extensions/services/dashboard/src/components/TemplatePicker.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export function TemplatePreview({ template, onClose, onApplied }) {
149149
timeout: 120000,
150150
})
151151
if (!res.ok) throw new Error(`HTTP ${res.status}`)
152-
const data = await res.json().catch(() => ({}))
152+
const data = await res.json()
153153
if (data.enabled_count > 0) {
154154
setApplied(data.restart_required ? 'restart_required' : 'enabled')
155155
} else {

0 commit comments

Comments
 (0)