Skip to content

Commit

Permalink
Add debug logs in onExceptionThrown
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur22 committed Jan 21, 2025
1 parent 8a5aca7 commit 638eb16
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/modules/k6/browser/common/frame_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,14 @@ func (fs *FrameSession) onConsoleAPICalled(event *cdpruntime.EventConsoleAPICall
l.Debug(msg)
}

// We should consider building an API around this as it could be useful
// information about the user's website not handling exceptions.
func (fs *FrameSession) onExceptionThrown(event *cdpruntime.EventExceptionThrown) {
// TODO: Test and handle this
fs.logger.Debugf("FrameSession:onExceptionThrown",
"sid:%v tid:%v url:%s line:%d col:%d text:%s",
fs.session.ID(), fs.targetID, event.ExceptionDetails.URL,
event.ExceptionDetails.LineNumber, event.ExceptionDetails.ColumnNumber,
event.ExceptionDetails.Text)
}

func (fs *FrameSession) onExecutionContextCreated(event *cdpruntime.EventExecutionContextCreated) {
Expand Down

0 comments on commit 638eb16

Please sign in to comment.