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

@@ -38,7 +38,14 @@ func mapPublicError(err error) error {
if publicErr == nil {
return err
}
return fmt.Errorf("%w: %w", publicErr, err)
switch {
case errors.Is(err, llm.ErrTransport):
return fmt.Errorf("%w: %w: %w", publicErr, ErrTransport, err)
case errors.Is(err, llm.ErrMalformedResponse):
return fmt.Errorf("%w: %w: %w", publicErr, ErrMalformedResponse, err)
default:
return fmt.Errorf("%w: %w", publicErr, err)
}
}
func publicErrorFor(err error) error {