Enhance error logging for repo existence check
Improve error handling in repository existence check.
This commit is contained in:
parent
a71009ff78
commit
e5d8827fd8
1 changed files with 5 additions and 1 deletions
|
|
@ -205,7 +205,11 @@ async function importRepositories(repositories: unknown[]): Promise<ImportResult
|
||||||
const isAlreadyRepo = await restic
|
const isAlreadyRepo = await restic
|
||||||
.snapshots({ ...r.config, isExistingRepository: true } as RepositoryConfig)
|
.snapshots({ ...r.config, isExistingRepository: true } as RepositoryConfig)
|
||||||
.then(() => true)
|
.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) {
|
if (isAlreadyRepo) {
|
||||||
logger.warn(
|
logger.warn(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue