Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: İnanç Gümüş <[email protected]>
  • Loading branch information
ankur22 and inancgumus committed Jan 11, 2024
1 parent d921bb4 commit b2b536b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions common/element_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ func (h *ElementHandle) ContentFrame() (*Frame, error) {

frame, found := h.frame.manager.getFrameByID(node.FrameID)
if !found {
return nil, fmt.Errorf("frame not found for id")
return nil, fmt.Errorf("frame not found for id %s", node.FrameID)
}

return frame, nil
Expand Down Expand Up @@ -1010,7 +1010,7 @@ func (h *ElementHandle) OwnerFrame() (*Frame, error) {

frame, found := h.frame.manager.getFrameByID(node.FrameID)
if !found {
return nil, fmt.Errorf("no frame found for id")
return nil, fmt.Errorf("no frame found for id %s", node.FrameID)
}

return frame, nil
Expand Down
5 changes: 2 additions & 3 deletions common/frame_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,8 @@ func (m *FrameManager) frameRequestedNavigation(frameID cdp.FrameID, url string,
return nil
}

// getFrameByID will attempt to find a frame with the given id. If one is found
// the frame and true will be returned. If one isn't found nil and false will
// be returned.
// getFrameByID finds a frame with id. If found, it returns the frame and true,
// otherwise, it returns nil and false.
func (m *FrameManager) getFrameByID(id cdp.FrameID) (*Frame, bool) {
m.framesMu.RLock()
defer m.framesMu.RUnlock()
Expand Down

0 comments on commit b2b536b

Please sign in to comment.