From dcb707cbc617224c6a979538c7ccd4f9caf121a1 Mon Sep 17 00:00:00 2001 From: Kyriakos Akriotis Date: Wed, 14 Oct 2026 13:57:45 +0200 Subject: [PATCH] added setError for activation, details and plugins resource update #145 --- internal/ui/app.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/ui/app.go b/internal/ui/app.go index 026efe9..6efab07 100644 --- a/internal/ui/app.go +++ b/internal/ui/app.go @@ -455,8 +455,8 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.loadingLabel = "" if msg.Err != nil { - m.err = fmt.Errorf("context activation failed: %v", msg.Err) - slog.Error(m.err.Error(), "cloud", msg.Context.Cloud) + m.setError(fmt.Errorf("context activation failed: %v", msg.Err)) + slog.Error(msg.Err.Error(), "cloud", msg.Context.Cloud) return m, nil } @@ -555,8 +555,8 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.loadingLabel = "" if msg.Err != nil { - m.err = fmt.Errorf("loading resource details failed: %v", msg.Err) - slog.Error(m.err.Error(), "cloud", m.context.Cloud) + m.setError(fmt.Errorf("loading resource details failed: %v", msg.Err)) + slog.Error(msg.Err.Error(), "cloud", m.context.Cloud) return m, nil } @@ -572,7 +572,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { default: data, err := json.MarshalIndent(content, "", " ") if err != nil { - m.err = fmt.Errorf("encoding details: %v", err) + m.setError(fmt.Errorf("encoding details: %v", err)) return m, nil } @@ -612,8 +612,8 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { case pluginresource.UpdatedMsg: if msg.Err != nil { - m.err = fmt.Errorf("updating plugin failed: %v", msg.Err) - slog.Error(m.err.Error(), "cloud", m.context.Cloud) + m.setError(fmt.Errorf("updating plugin failed: %v", msg.Err)) + slog.Error(msg.Err.Error(), "cloud", m.context.Cloud) return m, nil }