Expose transport and malformed generation errors

This commit is contained in:
2026-09-23 16:37:47 +00:00
parent 056bfd0289
commit ea94d66fc2
8 changed files with 127 additions and 5 deletions

View File

@@ -73,3 +73,10 @@ func TestMapPublicErrorPreservesValidationAroundGenerationError(t *testing.T) {
t.Fatalf("mapped error exposes internal ProviderHTTPError: %v", err)
}
}
func TestMapPublicErrorDoesNotTreatRequestEncodingAsTransport(t *testing.T) {
err := mapPublicError(fmt.Errorf("%w: %w", usecase.ErrLLMGenerate, llm.ErrRequestFailed))
if !errors.Is(err, ErrLLMGenerate) || errors.Is(err, ErrTransport) {
t.Fatalf("request encoding category = %v", err)
}
}