chore(core): Add error log for more detail when git phases fail (#16994)

This commit is contained in:
Guillaume Jacquart
2025-07-04 13:36:04 +02:00
committed by GitHub
parent f2eb38617f
commit 5733999de5

View File

@@ -51,6 +51,7 @@ export class SourceControlGitService {
}); });
this.logger.debug(`Git binary found: ${gitResult.toString()}`); this.logger.debug(`Git binary found: ${gitResult.toString()}`);
} catch (error) { } catch (error) {
this.logger.error('Git binary check failed', { error });
throw new UnexpectedError('Git binary not found', { cause: error }); throw new UnexpectedError('Git binary not found', { cause: error });
} }
try { try {
@@ -59,6 +60,7 @@ export class SourceControlGitService {
}); });
this.logger.debug(`SSH binary found: ${sshResult.toString()}`); this.logger.debug(`SSH binary found: ${sshResult.toString()}`);
} catch (error) { } catch (error) {
this.logger.error('SSH binary check failed', { error });
throw new UnexpectedError('SSH binary not found', { cause: error }); throw new UnexpectedError('SSH binary not found', { cause: error });
} }
return true; return true;
@@ -153,6 +155,7 @@ export class SourceControlGitService {
return true; return true;
} }
} catch (error) { } catch (error) {
this.logger.error('Git remote check failed', { error });
throw new UnexpectedError('Git is not initialized', { cause: error }); throw new UnexpectedError('Git is not initialized', { cause: error });
} }
this.logger.debug(`Git remote not found: ${remote}`); this.logger.debug(`Git remote not found: ${remote}`);
@@ -256,6 +259,7 @@ export class SourceControlGitService {
currentBranch: current, currentBranch: current,
}; };
} catch (error) { } catch (error) {
this.logger.error('Failed to get branches', { error });
throw new UnexpectedError('Could not get remote branches from repository', { cause: error }); throw new UnexpectedError('Could not get remote branches from repository', { cause: error });
} }
} }