fix: reduce invalid config log noise

This commit is contained in:
Peter Steinberger
2026-01-22 02:47:42 +00:00
parent f1aa260b0e
commit 9d22646120
2 changed files with 6 additions and 1 deletions

View File

@@ -247,7 +247,7 @@ export function createConfigIO(overrides: ConfigIoDeps = {}) {
.join("\n");
if (!loggedInvalidConfigs.has(configPath)) {
loggedInvalidConfigs.add(configPath);
deps.logger.error(`Invalid config:\\n${details}`);
deps.logger.error(`Invalid config at ${configPath}:\\n${details}`);
}
const error = new Error("Invalid config");
(error as { code?: string; details?: string }).code = "INVALID_CONFIG";
@@ -299,6 +299,10 @@ export function createConfigIO(overrides: ConfigIoDeps = {}) {
deps.logger.error(err.message);
throw err;
}
const error = err as { code?: string };
if (error?.code === "INVALID_CONFIG") {
return {};
}
deps.logger.error(`Failed to read config at ${configPath}`, err);
return {};
}