refactor: deepen gsdtools query execution seams

This commit is contained in:
Tom Boucher
2026-05-03 18:31:06 -04:00
parent 42ed7cee8d
commit 9d096b9925
5 changed files with 7 additions and 48 deletions

View File

@@ -1,6 +1,6 @@
import { execFile } from 'node:child_process';
import { readFile } from 'node:fs/promises';
import type { GSDToolsError } from './gsd-tools-error.js';
import type { GSDToolsError } from './gsd-tools.js';
export interface QuerySubprocessAdapterDeps {
projectDir: string;
@@ -103,18 +103,6 @@ export class QuerySubprocessAdapter {
(error, stdout, stderr) => {
const stderrStr = stderr?.toString() ?? '';
if (error) {
if (error.killed || (error as NodeJS.ErrnoException).code === 'ETIMEDOUT') {
reject(
this.deps.createToolsError(
`gsd-tools timed out after ${this.deps.timeoutMs}ms: ${command} ${args.join(' ')}`,
command,
args,
null,
stderrStr,
),
);
return;
}
reject(
this.deps.createToolsError(
`gsd-tools exited with code ${error.code ?? 'unknown'}: ${command} ${args.join(' ')}${stderrStr ? `\n${stderrStr}` : ''}`,