Skip to content

feat(python): unify GAOS HTTP errors onto native APIError and export GAOS error classes - #3236

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara/1008500737
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara/1008500737

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

feat(python): unify GAOS HTTP errors onto native APIError and export GAOS error classes

Have 4xx/5xx GAOS compatibility error classes (APIStatusError, BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError, and unmapped 4xx status errors) also inherit from native google.genai.errors.APIError (ClientError for 4xx, ServerError for 5xx) via multiple inheritance, and populate the native code, status, and details attributes alongside existing status_code and body attributes. Non-HTTP and schema validation errors (APIConnectionError, APITimeoutError, APIResponseValidationError) remain compat-only.

Also export the GAOS error classes on google.genai.interactions, google.genai.private.interactions, google.genai.errors (with InteractionsAPIError aliasing compat APIError), and google.genai.private.errors, and deduplicate _gaos_private.lib.compat_errors against _gaos.lib.compat_errors.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#3209 from googleapis:release-please--branches--main 39c95f2

@copybara-service
copybara-service Bot force-pushed the copybara/1008500737 branch 4 times, most recently from 39d7bb3 to 4182c35 Compare October 29, 2026 20:36
…GAOS error classes

Have 4xx/5xx GAOS compatibility error classes (`APIStatusError`, `BadRequestError`, `AuthenticationError`, `PermissionDeniedError`, `NotFoundError`, `ConflictError`, `UnprocessableEntityError`, `RateLimitError`, `InternalServerError`, and unmapped 4xx status errors) also inherit from native `google.genai.errors.APIError` (`ClientError` for 4xx, `ServerError` for 5xx) via multiple inheritance, and populate the native `code`, `status`, and `details` attributes alongside existing `status_code` and `body` attributes. Non-HTTP and schema validation errors (`APIConnectionError`, `APITimeoutError`, `APIResponseValidationError`) remain compat-only.

Also export the GAOS error classes on `google.genai.interactions`, `google.genai.private.interactions`, `google.genai.errors` (with `InteractionsAPIError` aliasing compat `APIError`), and `google.genai.private.errors`, and deduplicate `_gaos_private.lib.compat_errors` against `_gaos.lib.compat_errors`.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#3209 from googleapis:release-please--branches--main 39c95f2
PiperOrigin-RevId: 1008500737

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant