refactor: split subprocess timeout and failure error seams

This commit is contained in:
Tom Boucher
2026-05-04 20:05:09 -04:00
parent 41683b2f53
commit 6fe4af2546
3 changed files with 25 additions and 19 deletions

View File

@@ -33,10 +33,10 @@ export function createGSDToolsRuntime(opts: {
gsdToolsPath: opts.gsdToolsPath,
timeoutMs: opts.timeoutMs,
workstream: opts.workstream,
createToolsError: (message, command, args, exitCode, stderr, classification) =>
classification?.kind === 'timeout'
? GSDToolsError.timeout(message, command, args, stderr, classification.timeoutMs, { exitCode })
: GSDToolsError.failure(message, command, args, exitCode, stderr),
createTimeoutError: (message, command, args, stderr, timeoutMs) =>
GSDToolsError.timeout(message, command, args, stderr, timeoutMs),
createFailureError: (message, command, args, exitCode, stderr) =>
GSDToolsError.failure(message, command, args, exitCode, stderr),
});
const nativeDirectAdapter = new QueryNativeDirectAdapter({