Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unsupportedUserLocation case to GenerateContentError #85

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

andrewheard
Copy link
Collaborator

Added a specific GenerateContentError case unsupportedUserLocation that is thrown when the API is called from a location not in the list of available regions. Previously, this was thrown as an internalError, requiring developers to look at the underlying error to determine the failure reason (#82).

@github-actions github-actions bot added component:swift sdk Issue/PR related to Swift SDK status:awaiting review PR awaiting review from a maintainer labels Jan 8, 2024
Copy link
Collaborator

@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

andrewheard

This comment was marked as outdated.

Copy link
Collaborator

@peterfriese peterfriese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one suggestion.

We should coordinate with the other SDK teams to make sure they provide a similar mechanism.

Also wouldn't hurt to add this to the sample app(s) to show how to use this.

Sources/GoogleAI/GenerateContentError.swift Outdated Show resolved Hide resolved
@andrewheard
Copy link
Collaborator Author

Updated this PR to match the approach from #93.

@andrewheard andrewheard merged commit ce40a67 into main Jan 26, 2024
8 checks passed
@andrewheard andrewheard deleted the ah/user-location-error branch January 26, 2024 16:58
@github-actions github-actions bot removed the status:awaiting review PR awaiting review from a maintainer label Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:swift sdk Issue/PR related to Swift SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants