Enhance error logging for repo existence check

Improve error handling in repository existence check.
This commit is contained in:
Jakub Trávník 2025-12-29 20:46:21 +01:00 committed by GitHub
parent a71009ff78
commit e5d8827fd8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -205,7 +205,11 @@ async function importRepositories(repositories: unknown[]): Promise<ImportResult
const isAlreadyRepo = await restic
.snapshots({ ...r.config, isExistingRepository: true } as RepositoryConfig)
.then(() => true)
.catch(() => false);
.catch((e) => {
const err = e instanceof Error ? e : new Error(String(e));
logger.debug(`Repo existence check for '${r.name}': ${err.message}`);
return false;
});
if (isAlreadyRepo) {
logger.warn(