mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-17 06:17:09 +00:00
fix(completion): fail closed on backend errors
- silence unexpected completion backend exceptions so TAB completion does not emit stack traces
This commit is contained in:
@@ -254,7 +254,11 @@ function formatForShell(
|
||||
}
|
||||
|
||||
export async function handleCompletionCommand(args: string[]): Promise<void> {
|
||||
const request = parseCompletionArgs(args);
|
||||
const suggestions = getCompletionSuggestions(request);
|
||||
process.stdout.write(formatForShell(request.shell, suggestions).join('\n'));
|
||||
try {
|
||||
const request = parseCompletionArgs(args);
|
||||
const suggestions = getCompletionSuggestions(request);
|
||||
process.stdout.write(formatForShell(request.shell, suggestions).join('\n'));
|
||||
} catch {
|
||||
// Completion must fail closed and quietly so shell TAB does not surface stack traces.
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user