fix: reduce invalid config log noise
This commit is contained in:
@@ -11,6 +11,7 @@ Docs: https://docs.clawd.bot
|
|||||||
- Signal: add typing indicators and DM read receipts via signal-cli.
|
- Signal: add typing indicators and DM read receipts via signal-cli.
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
- Config: avoid stack traces for invalid configs and log the config path.
|
||||||
- Doctor: warn when gateway.mode is unset with configure/config guidance.
|
- Doctor: warn when gateway.mode is unset with configure/config guidance.
|
||||||
- macOS: include Textual syntax highlighting resources in packaged app to prevent chat crashes. (#1362)
|
- macOS: include Textual syntax highlighting resources in packaged app to prevent chat crashes. (#1362)
|
||||||
- UI: refresh debug panel on route-driven tab changes. (#1373) Thanks @yazinsai.
|
- UI: refresh debug panel on route-driven tab changes. (#1373) Thanks @yazinsai.
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ export function createConfigIO(overrides: ConfigIoDeps = {}) {
|
|||||||
.join("\n");
|
.join("\n");
|
||||||
if (!loggedInvalidConfigs.has(configPath)) {
|
if (!loggedInvalidConfigs.has(configPath)) {
|
||||||
loggedInvalidConfigs.add(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");
|
const error = new Error("Invalid config");
|
||||||
(error as { code?: string; details?: string }).code = "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);
|
deps.logger.error(err.message);
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
const error = err as { code?: string };
|
||||||
|
if (error?.code === "INVALID_CONFIG") {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
deps.logger.error(`Failed to read config at ${configPath}`, err);
|
deps.logger.error(`Failed to read config at ${configPath}`, err);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user