diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-19 09:05:29 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-19 09:05:29 +0200 |
| commit | 0918aad469ac2ff5513a7131661f1106e5ec851c (patch) | |
| tree | 90ecf1245c1d98ec5e3c8ead77978206f2e61155 /internal/lsp/handlers_utils.go | |
| parent | 31394385e72dd3a317585838ed1696076043cc60 (diff) | |
Improve actionable error guidance
Diffstat (limited to 'internal/lsp/handlers_utils.go')
| -rw-r--r-- | internal/lsp/handlers_utils.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/lsp/handlers_utils.go b/internal/lsp/handlers_utils.go index 66e2ed1..e3c65a5 100644 --- a/internal/lsp/handlers_utils.go +++ b/internal/lsp/handlers_utils.go @@ -262,7 +262,14 @@ func (s *Server) chatWithStats(ctx context.Context, surface surfaceKind, spec re // Perform request client := s.clientFor(spec) if client == nil { - return "", fmt.Errorf("llm client unavailable") + provider := strings.TrimSpace(spec.provider) + if provider == "" { + provider = strings.TrimSpace(s.currentConfig().Provider) + } + if provider == "" { + return "", fmt.Errorf("llm client unavailable; check the configured provider and required API key") + } + return "", fmt.Errorf("llm client unavailable for provider %q; check the configured provider and required API key", provider) } modelUsed := spec.effectiveModel(client.DefaultModel()) txt, err := client.Chat(ctx, msgs, spec.options...) |
