question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing types for page error events.

See original GitHub issue

Hi, I can’t see the type definition of the page errors. For example:

page, _ := browserContext.NewPage()
page.Once("pageerror", func(err ???) {
	c.Logger().Errorf("an error on the page was detected: %s", err)
})

I also recommend using custom function types e.g

type RequestFailedEventHandler = func(request *Request)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mxschmittcommented, Jan 1, 2021

Cool, thanks for confirming. Some events like that or others are missing, try to come up with them over the next week.

Yeah I didn’t do much Go for a while and thought its fine to solve it like that. I wanted to keep the API pretty much the same as we have upstream so it corresponds with Python, Java or C#. If you have concrete improvements, I would be happy if you want to collaborate with me on the codebase, waitForEvent/newExpectWrapper is definitely something which is improvable. 👍

1reaction
StarpTechcommented, Jan 1, 2021

This issue was only about page error events. Your example would fix it. 👍

In general, I think the driver overuse reflection and empty interface. In many cases, we could develop against concrete types.

I like this approach https://mionskowski.pl/generic-event-dispatcher-in-go to handle events from different types.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing types for page error events. · Issue #65 - GitHub
Hi, I can't see the type definition of the page errors. For example: page, _ := browserContext.NewPage() page.Once("pageerror", func(err ?
Read more >
Missing Error Handling | OWASP Foundation
Missing Error Handling. Description. A web application must define a default error page for 404 errors, 500 errors, and to catch java.
Read more >
How to troubleshoot Meta Pixel error and warning messages ...
Error and warning messages you may see for the Meta Pixel in Events Manager · Missing event name: This error appears when your...
Read more >
TS error: Type 'event' is missing the following properties from ...
It's OK. The issue was eventName: string, TS sees that you are allowing to listen for any event (keyboard or not) so it...
Read more >
an error about missing fields - WordPress.org
hello, i just got an error in my google search console about missing fields thats related to events “matches”. Missing field “eventAttendanceMode” its...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found