Skip to content

Non try/catchable TimeoutError #84

@devingfx

Description

@devingfx

Hi !

I found a weird bug : this error, that occurs in a timeout is not catchable with a try/catch clause around puppeteer.launch.

let browser
try {
    browser = await puppeteer.launch({ ...opts })
}
catch(e)
{
    browser = await puppeteer.connect({ ...ws })
}

throw new TimeoutError(
`Timed out after ${timeout} ms while trying to connect to the browser! Only Chrome at revision r${preferredRevision} is guaranteed to work.`,
);

This occurs while trying to launch a browser / user-data-dir couple a second time, chrome won't open a new instance but instead open a new page on the existing browser instance, and though don't output to stdout the ws endpoint as usual...
The try / catch in fact work as expected, and connects to the instance instead in this case, but the sub task (out of scope) launch that failed will crash the process after 30s timeout not connecting... even if it was expicitely used in a try clause...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions