puppeteer-sharp icon indicating copy to clipboard operation
puppeteer-sharp copied to clipboard

PageErrorEventArgs does not return detailed information about Page errors

Open sgupta38 opened this issue 4 years ago • 0 comments

Puppeteer-sharp's PageErrorEventArgs is not returning detail information about the Page errors.

The following is the sample code snippet.

using (var browser = await Puppeteer.LaunchAsync(launchOptions))
            {
                using (var page = await browser.NewPageAsync())
                {
                    // Listen for `Page Errors`
                    page.PageError += (sender, eventArgs) =>
                    {
                            Console.WriteLine("Error Found:");
                            Console.WriteLine($"     {eventArgs.Message}");
                    };
                    
                    // Goto Page
                    await page.GoToAsync("https://www.unionbankofindia.co.in/english/home.aspx");

                    await page.CloseAsync();
                }
            }

The following is the comparison between puppeteer-sharp output and chrome dev tools output:

puppeteer-issue

As you can see, for some of the errors (marked with the little yellow line), information such as filename, line number, etc., is missing, and sometimes the whole error string is missing.

Expected behavior:

Shouldn't PageErrorEventArgs return all information about page errors?

Versions

sgupta38 avatar Jan 07 '22 17:01 sgupta38