Skip to content

Commit a22b99a

Browse files
trangeviwbreza
andauthored
Apply suggestion from @wbreza
Co-authored-by: Wallace Breza <wallace.breza@microsoft.com>
1 parent a4b2635 commit a22b99a

File tree

1 file changed

+6
-1
lines changed
  • cli/azd/extensions/azure.ai.agents/internal/cmd

1 file changed

+6
-1
lines changed

cli/azd/extensions/azure.ai.agents/internal/cmd/helpers.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ func resolveConfigPath(ctx context.Context, azdClient *azdext.AzdClient) (string
5252

5353
return filepath.Join(projectResponse.Project.Path, ".azure", envResponse.Environment.Name, ConfigFile), nil
5454
}
55-
55+
if err != nil {
56+
return "", fmt.Errorf("failed to get project config: %w", err)
57+
}
58+
if projectResponse.Project == nil {
59+
return "", fmt.Errorf("failed to get project config (is there an azure.yaml?)")
60+
}
5661
// loadLocalContext reads the .foundry-agent.json state file.
5762
// configPath is the full path to the config file (use resolveConfigPath to obtain it).
5863
func loadLocalContext(configPath string) *AgentLocalContext {

0 commit comments

Comments
 (0)