mirror of
https://github.com/glittercowboy/get-shit-done
synced 2026-05-05 06:42:14 +02:00
fix(#2544): config-get exits 1 on missing key (was 10, UNIX convention is 1)
Change ErrorClassification for 'Key not found' in configGet from Validation (exit 10) to Execution (exit 1), matching git config --get. Callers using `gsd-sdk query config-get k || fallback` need a non-zero exit to trigger the fallback branch; 10 worked technically but was semantically wrong and noisy. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -90,12 +90,12 @@ export const configGet: QueryHandler = async (args, projectDir) => {
|
||||
let current: unknown = config;
|
||||
for (const key of keys) {
|
||||
if (current === undefined || current === null || typeof current !== 'object') {
|
||||
throw new GSDError(`Key not found: ${keyPath}`, ErrorClassification.Validation);
|
||||
throw new GSDError(`Key not found: ${keyPath}`, ErrorClassification.Execution);
|
||||
}
|
||||
current = (current as Record<string, unknown>)[key];
|
||||
}
|
||||
if (current === undefined) {
|
||||
throw new GSDError(`Key not found: ${keyPath}`, ErrorClassification.Validation);
|
||||
throw new GSDError(`Key not found: ${keyPath}`, ErrorClassification.Execution);
|
||||
}
|
||||
|
||||
return { data: current };
|
||||
|
||||
Reference in New Issue
Block a user