diff --git a/js/modules/k6/browser/common/frame_session.go b/js/modules/k6/browser/common/frame_session.go index 392d63d8a45..eba9dfcf88c 100644 --- a/js/modules/k6/browser/common/frame_session.go +++ b/js/modules/k6/browser/common/frame_session.go @@ -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) {