Better error handling

This commit is contained in:
mudler
2024-04-16 10:26:55 +02:00
parent 56a6a10980
commit 4ed61daf8e

View File

@@ -152,9 +152,14 @@ func (g *GithubIssues) issuesService() {
continue continue
} }
go func() {
res := g.agent.Ask( res := g.agent.Ask(
agent.WithConversationHistory(messages), agent.WithConversationHistory(messages),
) )
if res.Error != nil {
slog.Error("Error asking", "error", res.Error)
return
}
_, _, err := g.client.Issues.CreateComment( _, _, err := g.client.Issues.CreateComment(
g.agent.Context(), g.agent.Context(),
@@ -164,7 +169,8 @@ func (g *GithubIssues) issuesService() {
}, },
) )
if err != nil { if err != nil {
slog.Info("Error creating comment", err) slog.Error("Error creating comment", "error", err)
} }
}()
} }
} }