Skip to content

Commit 1ab8c3d

Browse files
committed
Rename exception
1 parent 2c40ada commit 1ab8c3d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

firebase-ai/src/main/kotlin/com/google/firebase/ai/common/APIController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ private suspend fun validateResponse(response: HttpResponse) {
335335
throw PromptBlockedException(message)
336336
}
337337
if (message.contains("genai config not found")) {
338-
throw NotConfiguredException()
338+
throw GeminiNotConfiguredException()
339339
}
340340
getServiceDisabledErrorDetailsOrNull(error)?.let {
341341
val errorMessage =

firebase-ai/src/main/kotlin/com/google/firebase/ai/common/Exceptions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ internal class UnsupportedUserLocationException(cause: Throwable? = null) :
9696
* [steps](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting?api=dev#error-genai-config-not-found)
9797
* to enable the Gemini Developer API.
9898
*/
99-
internal class NotConfiguredException(cause: Throwable? = null) :
99+
internal class GeminiNotConfiguredException(cause: Throwable? = null) :
100100
FirebaseCommonAIException("Gemini Developer API not enabled in Firebase console.", cause)
101101

102102
/**

firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Exceptions.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ internal constructor(message: String, cause: Throwable? = null) : RuntimeExcepti
6161
ContentBlockedException(cause.message ?: "", cause.cause)
6262
is com.google.firebase.ai.common.QuotaExceededException ->
6363
QuotaExceededException(cause.message ?: "", cause.cause)
64-
is com.google.firebase.ai.common.NotConfiguredException ->
65-
NotConfiguredException(cause.cause)
64+
is com.google.firebase.ai.common.GeminiNotConfiguredException ->
65+
GeminiNotConfiguredException(cause.cause)
6666
else -> UnknownException(cause.message ?: "", cause)
6767
}
6868
is TimeoutCancellationException ->
@@ -158,7 +158,7 @@ public class UnsupportedUserLocationException internal constructor(cause: Throwa
158158
* [steps](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting?api=dev#error-genai-config-not-found)
159159
* to enable the Gemini Developer API.
160160
*/
161-
internal class NotConfiguredException internal constructor(cause: Throwable? = null) :
161+
internal class GeminiNotConfiguredException internal constructor(cause: Throwable? = null) :
162162
FirebaseAIException("Gemini Developer API not enabled in Firebase console.", cause)
163163

164164
/**

0 commit comments

Comments
 (0)