Yet more debug logging

This commit is contained in:
Jack Jackson 2025-03-05 18:37:34 -08:00
parent 2bc85cf6d6
commit e0f735e47a
7 changed files with 22 additions and 0 deletions

11
dist/index.js vendored
View File

@ -25719,6 +25719,11 @@ function getCommitsSinceLatestBeforeGivenDate(dir, date) {
// No commits in the target repo - return an empty array, which will result in the first representative commit
// being made as the first commit. And then we can iterate as normal (recalling that the target history is
// refreshed _from local repo_ - incurring no network charges) from there on.
if (error.output == undefined) {
throw Error(`Unexpected error while building target commit history`, {
cause: error
});
}
const errorOutputAsString = '' + error.output[2];
if (!errorOutputAsString.includes('does not have any commits yet')) {
console.log(`Unexpected error: ${errorOutputAsString}`);
@ -25790,7 +25795,13 @@ function createRepresentativeCommit(dir, sourceRepo, sourceCommit) {
}
catch (e) {
console.log(e);
console.log(`DEBUG - e is ${e}`);
const error = e;
if (error.output == undefined) {
throw Error(`Unexpected error while creating representative commit`, {
cause: error
});
}
console.log(`DEBUG - error while creating representative commit: ${'' + error.output[2]} ... ${'' + error.output[1]}`);
throw e;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -74,6 +74,11 @@ export function getCommitsSinceLatestBeforeGivenDate(dir: string, date: Date): C
// No commits in the target repo - return an empty array, which will result in the first representative commit
// being made as the first commit. And then we can iterate as normal (recalling that the target history is
// refreshed _from local repo_ - incurring no network charges) from there on.
if (error.output == undefined) {
throw Error(`Unexpected error while building target commit history`, {
cause: error
})
}
const errorOutputAsString = '' + error.output[2]
if (!errorOutputAsString.includes('does not have any commits yet')) {
console.log(`Unexpected error: ${errorOutputAsString}`);
@ -150,7 +155,13 @@ function createRepresentativeCommit(dir: string, sourceRepo: RepoId,sourceCommit
})
} catch (e) {
console.log(e);
console.log(`DEBUG - e is ${e}`);
const error = e as ExecSyncError;
if (error.output == undefined) {
throw Error(`Unexpected error while creating representative commit`, {
cause: error
})
}
console.log(`DEBUG - error while creating representative commit: ${'' + error.output[2]} ... ${'' + error.output[1]}`);
throw e;
}