Stops re-throw of know errors

This commit is contained in:
Eric Amodio
2017-03-27 12:08:53 -04:00
parent 5c2712bcb7
commit e1190d50a4

View File

@@ -27,6 +27,7 @@ async function gitCommand(cwd: string, ...args: any[]) {
const msg = ex && ex.toString();
if (msg && (msg.includes('Not a git repository') || msg.includes('is outside repository') || msg.includes('no such path'))) {
Logger.warn('git', ...args, ` cwd='${cwd}'`, msg && `\n ${msg.replace(/\r?\n|\r/g, ' ')}`);
return '';
}
else {
Logger.error(ex, 'git', ...args, ` cwd='${cwd}'`, msg && `\n ${msg.replace(/\r?\n|\r/g, ' ')}`);