fix(web): correctement render erreur d'accès au serveur API

This commit is contained in:
Victor Lacasse-Beaudoin 2024-06-20 19:54:41 -04:00
parent 244276905b
commit 0321b1b2a0

6
cmd.go
View file

@ -163,7 +163,11 @@ var webCmd = &cobra.Command{
e.GET("/", func(c echo.Context) error { e.GET("/", func(c echo.Context) error {
pingResult, err := apiClient.GetHealth() pingResult, err := apiClient.GetHealth()
if err != nil { if err != nil {
log.Fatal(err) return c.Render(
http.StatusOK,
"index-html",
voki.MessageResponse{Message: fmt.Sprintf("impossible d'accéder au serveur API: %s", err)},
)
} }
return c.Render( return c.Render(