E0406: A handler returns what the app can't write
A handler's results become the response: nothing (204), an error, a value (JSON, or HTML for a ui.Node), a value and an error, or a Result[T] (vuka.Result[T] in Go). Other result lists can't be written. Reported at boot, and by vukavet.
Wrong
vuka
@web.Get("/pets/{id}")
func ShowPet(id int) (Pet, int, error) { … }go
func ShowPet(id int) (Pet, int, error) { return Pet{}, 0, nil }
func init() { web.Routes.Get("/pets/{id}", ShowPet) }Right
vuka
@web.Get("/pets/{id}")
func ShowPet(id int) Result[Pet] { … }go
func ShowPet(id int) (Pet, error) { return Pet{}, nil }
func init() { web.Routes.Get("/pets/{id}", ShowPet) }