refactor: remove thin runtime and tools error wrappers
This commit is contained in:
@@ -107,10 +107,6 @@ export class GSDTools {
|
|||||||
return resolveQueryCommand(command, args, this.registry);
|
return resolveQueryCommand(command, args, this.registry);
|
||||||
}
|
}
|
||||||
|
|
||||||
private toToolsError(command: string, args: string[], err: unknown): GSDToolsError {
|
|
||||||
return toToolsErrorFromUnknown(command, args, err);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async dispatchNativeHotpath(
|
private async dispatchNativeHotpath(
|
||||||
legacyCommand: string,
|
legacyCommand: string,
|
||||||
legacyArgs: string[],
|
legacyArgs: string[],
|
||||||
@@ -133,7 +129,7 @@ export class GSDTools {
|
|||||||
return await work();
|
return await work();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err instanceof GSDToolsError) throw err;
|
if (err instanceof GSDToolsError) throw err;
|
||||||
throw this.toToolsError(command, args, err);
|
throw toToolsErrorFromUnknown(command, args, err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ export function createGSDToolsRuntime(opts: {
|
|||||||
request.registryCommand,
|
request.registryCommand,
|
||||||
request.registryArgs,
|
request.registryArgs,
|
||||||
),
|
),
|
||||||
execSubprocessJson: async (legacyCommand, legacyArgs) => subprocessAdapter.execJson(legacyCommand, legacyArgs),
|
execSubprocessJson: (legacyCommand, legacyArgs) => subprocessAdapter.execJson(legacyCommand, legacyArgs),
|
||||||
execSubprocessRaw: async (legacyCommand, legacyArgs) => subprocessAdapter.execRaw(legacyCommand, legacyArgs),
|
execSubprocessRaw: (legacyCommand, legacyArgs) => subprocessAdapter.execRaw(legacyCommand, legacyArgs),
|
||||||
formatNativeRaw: (registryCommand, data) => formatQueryRawOutput(registryCommand, data),
|
formatNativeRaw: (registryCommand, data) => formatQueryRawOutput(registryCommand, data),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user