mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix: a human-readable error when lock cannot be acquired (#8768)
Fixes #8709
This commit is contained in:
parent
25b5927a4d
commit
32ea4f542b
@ -562,6 +562,25 @@ export class Registry {
|
||||
else
|
||||
throw new Error(`ERROR: Playwright does not support installing ${executable.name}`);
|
||||
}
|
||||
} catch (e) {
|
||||
if (e.code === 'ELOCKED') {
|
||||
const rmCommand = process.platform === 'win32' ? 'rm -R' : 'rm -rf';
|
||||
throw new Error('\n' + wrapInASCIIBox([
|
||||
`An active lockfile is found at:`,
|
||||
``,
|
||||
` ${lockfilePath}`,
|
||||
``,
|
||||
`Either:`,
|
||||
`- wait a few minutes if other Playwright is installing browsers in parallel`,
|
||||
`- remove lock manually with:`,
|
||||
``,
|
||||
` ${rmCommand} ${lockfilePath}`,
|
||||
``,
|
||||
`<3 Playwright Team`,
|
||||
].join('\n'), 1));
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
} finally {
|
||||
await releaseLock();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user