Fixes incorrect 'Unable to find Git' message

This commit is contained in:
Eric Amodio
2016-11-17 01:05:03 -05:00
parent 968eb6e7eb
commit 5cb0053a05
3 changed files with 10 additions and 8 deletions

View File

@@ -34,18 +34,18 @@ async function findGitDarwin(): Promise<IGit> {
}
catch (ex) {
if (ex.code === 2) {
return Promise.reject('Unable to find git');
return Promise.reject(new Error('Unable to find git'));
}
return findSpecificGit(path);
}
}
catch (ex) {
return Promise.reject('Unable to find git');
return Promise.reject(new Error('Unable to find git'));
}
}
function findSystemGitWin32(basePath: string): Promise<IGit> {
if (!basePath) return Promise.reject('Unable to find git');
if (!basePath) return Promise.reject(new Error('Unable to find git'));
return findSpecificGit(path.join(basePath, 'Git', 'cmd', 'git.exe'));
}
@@ -69,7 +69,7 @@ export async function findGitPath(path?: string): Promise<IGit> {
}
}
catch (ex) {
return Promise.reject('Unable to find git');
return Promise.reject(new Error('Unable to find git'));
}
}
}