Async await unlimited callback

the library used is puppeteer,. As soon as you cannot access url, you will get stuck in infinite callback waiting. How to solve this problem

const puppeteer = require("puppeteer-core");

async function test() {
    const browser = await puppeteer.launch({executablePath: "/opt/google/Chromium/chrome"});
    const page = await browser.newPage();
    await page.goto("https://www.baidu/top");
    await page.screenshot({path: "example.png"});

    await browser.close();
};

test().catch(error => console.log(error.message));
Mar.03,2022

catch the timeout exception, because the code made an error in goto , so browser was not closed correctly, causing the nodejs not to end correctly.
so we need to use some methods to ensure that browser can correctly close

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a8b0-2b99d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a8b0-2b99d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?