-
Notifications
You must be signed in to change notification settings - Fork 633
Add NotConfiguredException with a better error message than provided by the server. #7233
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,8 @@ internal constructor(message: String, cause: Throwable? = null) : RuntimeExcepti | |
ContentBlockedException(cause.message ?: "", cause.cause) | ||
is com.google.firebase.ai.common.QuotaExceededException -> | ||
QuotaExceededException(cause.message ?: "", cause.cause) | ||
is com.google.firebase.ai.common.NotConfiguredException -> | ||
NotConfiguredException(cause.cause) | ||
else -> UnknownException(cause.message ?: "", cause) | ||
} | ||
is TimeoutCancellationException -> | ||
|
@@ -149,6 +151,16 @@ internal constructor(message: String, cause: Throwable? = null) : | |
public class UnsupportedUserLocationException internal constructor(cause: Throwable? = null) : | ||
FirebaseAIException("User location is not supported for the API use.", cause) | ||
|
||
/** | ||
* The user's project does not have the Gemini Developer API enabled in the Firebase Console. | ||
* | ||
* See the Firebase documentation for the | ||
* [steps](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting?api=dev#error-genai-config-not-found) | ||
* to enable the Gemini Developer API. | ||
*/ | ||
internal class NotConfiguredException internal constructor(cause: Throwable? = null) : | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this specific to "GenAI" or can it be thrown if VertexAI is not configured? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The error message this spawns from is genai only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should it be called |
||
FirebaseAIException("Gemini Developer API not enabled in Firebase console.", cause) | ||
|
||
/** | ||
* Some form of state occurred that shouldn't have. | ||
* | ||
|
Uh oh!
There was an error while loading. Please reload this page.