Skip to content

Commit 5685d29

Browse files
cpcloudclaude
andcommitted
fix(ui): return error from handleFormSubmit when no handler matches
Previously handleFormSubmit silently returned nil when handlerForFormKind returned no handler, swallowing a potential programming error. Now it returns a descriptive error so mismatches surface immediately. closes #252 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ecdaa89 commit 5685d29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/app/forms.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ func (m *Model) handleFormSubmit() error {
12021202
}
12031203
handler := m.handlerForFormKind(m.formKind)
12041204
if handler == nil {
1205-
return nil
1205+
return fmt.Errorf("no handler for form kind %v", m.formKind)
12061206
}
12071207
return handler.SubmitForm(m)
12081208
}

0 commit comments

Comments
 (0)