From 65f29061bc32bfcb1bbddf0de61ebdfc0fba6b5d Mon Sep 17 00:00:00 2001 From: sai k Date: Fri, 19 Jun 2026 02:03:27 +0530 Subject: [PATCH] fix(project): handle registry list retrieval error gracefully Signed-off-by: saiashok103@gmail.com Signed-off-by: saiashok0981 --- pkg/views/project/create/view.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkg/views/project/create/view.go b/pkg/views/project/create/view.go index aba8ecadb..5fa4cb2d1 100644 --- a/pkg/views/project/create/view.go +++ b/pkg/views/project/create/view.go @@ -53,15 +53,17 @@ func getRegistryList() (*registry.ListRegistriesOK, error) { func CreateProjectView(createView *CreateView) error { theme := huh.ThemeCharm() - // I want it to be a map of registry ID to registry name + // Registry list is optional: if retrieval fails, the proxy-cache registry + // selector will simply be hidden and the form can still proceed. + registryOptions := map[string]string{} registries, err := getRegistryList() if err != nil { - return err - } - registryOptions := map[string]string{} - for _, registry := range registries.Payload { - regiId := fmt.Sprintf("%d", registry.ID) - registryOptions[regiId] = fmt.Sprintf("%s (%s)", registry.Name, registry.URL) + log.Warnf("failed to retrieve registry list, proxy cache registry selection will be unavailable: %v", err) + } else { + for _, r := range registries.Payload { + regiId := fmt.Sprintf("%d", r.ID) + registryOptions[regiId] = fmt.Sprintf("%s (%s)", r.Name, r.URL) + } } var registrySelectOptions []huh.Option[string]