Skip to content

Open source AI coding agent. Designed for large projects and real world tasks.

fix: error handling

songzhibin97697ea130d244
diff --git a/app/cli/api/clients.go b/app/cli/api/clients.go
index 2f03597b..69cc1895 100644
--- a/app/cli/api/clients.go
+++ b/app/cli/api/clients.go
@@ -46,7 +46,10 @@ type authenticatedTransport struct {
// RoundTrip executes a single HTTP transaction and adds a custom header
func (t *authenticatedTransport) RoundTrip(req *http.Request) (*http.Response, error) {
- auth.SetAuthHeader(req)
+ err := auth.SetAuthHeader(req)
+ if err != nil {
+ return nil, err
+ }
return t.underlyingTransport.RoundTrip(req)
}
diff --git a/app/cli/cmd/plans.go b/app/cli/cmd/plans.go
index 4c6698a5..a5185a7f 100644
--- a/app/cli/cmd/plans.go
+++ b/app/cli/cmd/plans.go
@@ -70,7 +70,8 @@ func listActive() {
}()
go func() {
- ctx, _ := context.WithTimeout(context.Background(), 500*time.Millisecond)
+ ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond)
+ defer cancel()
res, err := fs.GetChildProjectIdsWithPaths(ctx)