refactor: default typed failure classification across query errors

This commit is contained in:
Tom Boucher
2026-05-04 20:01:08 -04:00
parent 1ca7f58831
commit ccda572ade
4 changed files with 24 additions and 13 deletions

View File

@@ -37,6 +37,17 @@ describe('query dispatch error mapper', () => {
expect(err.details).toMatchObject({ timeout_ms: 1234 });
});
it('maps typed failure classification from GSDToolsError', () => {
const err = mapNativeDispatchError(
new GSDToolsError('boom', 'state', ['load'], 1, '', {
classification: { kind: 'failure' },
}),
'state.load',
[],
);
expect(err.kind).toBe('native_failure');
});
it('maps fallback errors', () => {
const err = mapFallbackDispatchError(new Error('spawn ENOENT'), 'state', ['load']);
expect(err.kind).toBe('fallback_failure');