mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-05-20 00:57:09 +00:00
fix(config): restore catch-all in readConfig to prevent CLI crash on malformed config
This commit is contained in:
parent
2c43ec1ad0
commit
0803005083
1 changed files with 2 additions and 5 deletions
|
|
@ -33,11 +33,8 @@ export async function readConfig(): Promise<CodeburnConfig> {
|
|||
try {
|
||||
const raw = await readFile(getConfigPath(), 'utf-8')
|
||||
return JSON.parse(raw) as CodeburnConfig
|
||||
} catch (error) {
|
||||
if ((error as NodeJS.ErrnoException).code === 'ENOENT') {
|
||||
return {}
|
||||
}
|
||||
throw error
|
||||
} catch {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue