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:
Tom Boucher
2026-04-22 09:53:46 -04:00
parent dd06a26e2e
commit 726003563a
3 changed files with 83 additions and 2 deletions

View File

@@ -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 };