Skip to content

Commit

Permalink
fixup! Refactor to work with the filePersister
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur22 committed Jan 30, 2024
1 parent c502205 commit 39d2db9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/screenshotter.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ type screenshotter struct {
persister *storage.LocalFilePersister
}

func newScreenshotter(ctx context.Context, persister *storage.LocalFilePersister) *screenshotter {
return &screenshotter{ctx, persister}
func newScreenshotter(ctx context.Context, fp *storage.LocalFilePersister) *screenshotter {
return &screenshotter{ctx, fp}
}

func (s *screenshotter) fullPageSize(p *Page) (*Size, error) {
Expand Down Expand Up @@ -218,7 +218,7 @@ func (s *screenshotter) screenshot(
// Save screenshot capture to file
if path != "" {
if err := s.persister.Persist(path, bytes.NewBuffer(buf)); err != nil {
return nil, fmt.Errorf("saving screenshot")
return nil, fmt.Errorf("saving screenshot: %w", err)
}
}

Expand Down

0 comments on commit 39d2db9

Please sign in to comment.