[Question] Timeout Error
See original GitHub issueI just tried this piece of code:
const playwright = require('playwright');
try {
await page.waitForSelector('.foo');
} catch (e) {
if (e instanceof playwright.errors.TimeoutError) {
// Do something if this is a timeout.
}
} else {
console.log(err);
}
}
I am running this with Jest however, so unsure if this affects it, but for me it ends up in the else branch. I assume that is not supposed to happen.
This does work:
if (err.name === 'TimeoutError')
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Timeout error code problem in one C++ question - CodeProject
This error message is typical from challenges sites, it simply means that you code takes too much time to execute. You simply forgot...
Read more >Timeout error when generating data in SQL Server 2014
We keep getting a timeout error when generating data in SQL Server 2014. We have tried changing the timeout settings but it doesn't...
Read more >how to solve timeout error for this code in hackerrank
Timeout error appears to be related to the scanf. If you look at the man page, scanf takes input from standard in.
Read more >"Terminated due to timeout" status - HackerRank Support Center
To overcome and avoid the error, refer to the HackerRank Coding Environment Specifications Page, to know the specific memory and time limit for ......
Read more >Timeout Error Diagnosis - FairCom
Timeout Error Diagnosis · Consider using the blocking lock timeout feature. · The client binary can be modified to produce a server stack...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think the issue could be with TimeoutError class being a different instance in the test (executed in vm script) vs jest-playwright environment (executed in top-level Node context). We had a similar issue with
instanceof RegExp
.More details: https://github.com/microsoft/playwright/pull/1048