@@ -233,15 +233,6 @@ func (a *subAgentAPIClient) Create(ctx context.Context, agent SubAgent) (SubAgen
233
233
if err != nil {
234
234
return SubAgent {}, err
235
235
}
236
- for _ , appError := range resp .AppCreationErrors {
237
- app := apps [appError .Index ]
238
-
239
- a .logger .Warn (ctx , "unable to create app" ,
240
- slog .F ("app_slug" , app .Slug ),
241
- slog .F ("field" , appError .GetField ()),
242
- slog .F ("error" , appError .GetError ()),
243
- )
244
- }
245
236
246
237
agent .Name = resp .Agent .Name
247
238
agent .ID , err = uuid .FromBytes (resp .Agent .Id )
@@ -252,6 +243,20 @@ func (a *subAgentAPIClient) Create(ctx context.Context, agent SubAgent) (SubAgen
252
243
if err != nil {
253
244
return agent , err
254
245
}
246
+
247
+ for _ , appError := range resp .AppCreationErrors {
248
+ app := apps [appError .Index ]
249
+
250
+ a .logger .Warn (ctx , "unable to create app" ,
251
+ slog .F ("agent_name" , agent .Name ),
252
+ slog .F ("agent_id" , agent .ID ),
253
+ slog .F ("directory" , agent .Directory ),
254
+ slog .F ("app_slug" , app .Slug ),
255
+ slog .F ("field" , appError .GetField ()),
256
+ slog .F ("error" , appError .GetError ()),
257
+ )
258
+ }
259
+
255
260
return agent , nil
256
261
}
257
262
0 commit comments