Skip to content

Commit

Permalink
Add screenshot error to span
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur22 committed Apr 22, 2024
1 parent 344f2f2 commit 355e1b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,9 @@ func (p *Page) Screenshot(opts *PageScreenshotOptions, sp ScreenshotPersister) (
s := newScreenshotter(spanCtx, sp)
buf, err := s.screenshotPage(p, opts)
if err != nil {
return nil, fmt.Errorf("taking screenshot of page: %w", err)
err = fmt.Errorf("taking screenshot of page: %w", err)
SpanRecordError(span, "screenshot failed", err)
return nil, err
}

return buf, err
Expand Down

0 comments on commit 355e1b5

Please sign in to comment.