Skip to content

Commit

Permalink
fix error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
porridge committed Apr 24, 2024
1 parent 5f24be9 commit e22a338
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ func Run(logger *slog.Logger, criSocketPath string, dockerConfigJSONPath string,
}
wg.Wait()
logger.Info("pulling images finished")
return fmt.Errorf("failed to list images for debugging before pulling: %w", listImagesForDebugging(ctx, logger, client, timing.ImageListTimeout, "after"))
if err := listImagesForDebugging(ctx, logger, client, timing.ImageListTimeout, "after"); err != nil {
return fmt.Errorf("failed to list images for debugging after pulling: %w", err)
}
return nil
}

func listImagesForDebugging(ctx context.Context, logger *slog.Logger, client criV1.ImageServiceClient, timeout time.Duration, stage string) error {
Expand Down

0 comments on commit e22a338

Please sign in to comment.