mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 23:16:26 +00:00
fix(gitFs): try/catch/throw on clone error (#2700)
This commit is contained in:
parent
70415861cd
commit
d728b4ac26
1 changed files with 6 additions and 1 deletions
|
@ -89,7 +89,12 @@ class Storage {
|
|||
await fs.emptyDir(cwd);
|
||||
git = Git(cwd).silent(true);
|
||||
const cloneStart = process.hrtime();
|
||||
await git.clone(config.url, '.', ['--depth=2', '--no-single-branch']);
|
||||
try {
|
||||
await git.clone(config.url, '.', ['--depth=2', '--no-single-branch']);
|
||||
} catch (err) /* istanbul ignore next */ {
|
||||
logger.debug({ err }, 'git clone error');
|
||||
throw new Error('platform-failure');
|
||||
}
|
||||
const cloneSeconds =
|
||||
Math.round(
|
||||
1 + 10 * convertHrtime(process.hrtime(cloneStart)).seconds
|
||||
|
|
Loading…
Reference in a new issue