-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Labels
Needs AttentionThis issue needs maintainer attention.This issue needs maintainer attention.platform: allIssues / PRs which are for all platforms.Issues / PRs which are for all platforms.plugin: ailabel issues for firebase_ai pluginlabel issues for firebase_ai plugintype: bugSomething isn't workingSomething isn't working
Description
Is there an existing issue for this?
- I have searched the existing issues.
Which plugins are affected?
Other
Which platforms are affected?
iOS, Android, macOS, Web, Windows
Description
Bug report
The QuotaExceeded and ServiceApiNotEnabled exception classes are defined in src/error.dart but are not exported from the main firebase_ai.dart barrel file.
This makes it impossible to catch these specific exceptions in user code.
Expected behavior
QuotaExceeded and ServiceApiNotEnabled should be exported like other exception classes (InvalidApiKey, ServerException, UnsupportedUserLocation).
Current export in firebase_ai.dart:
export 'src/error.dart'
show
FirebaseAIException,
FirebaseAISdkException,
InvalidApiKey,
ServerException,
UnsupportedUserLocation;Suggested fix:
export 'src/error.dart'
show
FirebaseAIException,
FirebaseAISdkException,
InvalidApiKey,
QuotaExceeded, // Add this
ServerException,
ServiceApiNotEnabled, // Add this
UnsupportedUserLocation;Reproducing the issue
import 'package:firebase_ai/firebase_ai.dart';
try {
// Call Firebase AI API
} on QuotaExceeded catch (e) { // Error: 'QuotaExceeded' isn't defined
// Handle quota exceeded
}Firebase Core version
4.2.1
Flutter Version
3.38.1
Relevant Log Output
Flutter dependencies
Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.
Additional context and comments
No response
Metadata
Metadata
Assignees
Labels
Needs AttentionThis issue needs maintainer attention.This issue needs maintainer attention.platform: allIssues / PRs which are for all platforms.Issues / PRs which are for all platforms.plugin: ailabel issues for firebase_ai pluginlabel issues for firebase_ai plugintype: bugSomething isn't workingSomething isn't working