mirror of
https://github.com/tommyxchow/frosty.git
synced 2026-03-13 09:10:02 +08:00
guard crashlytics call in error handler for test environments
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -179,11 +179,15 @@ abstract class BaseApiClient {
|
||||
if (exception is ServerException ||
|
||||
error.type == DioExceptionType.unknown ||
|
||||
error.type == DioExceptionType.badCertificate) {
|
||||
FirebaseCrashlytics.instance.recordError(
|
||||
exception,
|
||||
error.stackTrace,
|
||||
reason: '${error.requestOptions.method} ${error.requestOptions.uri}',
|
||||
);
|
||||
try {
|
||||
FirebaseCrashlytics.instance.recordError(
|
||||
exception,
|
||||
error.stackTrace,
|
||||
reason: '${error.requestOptions.method} ${error.requestOptions.uri}',
|
||||
);
|
||||
} catch (_) {
|
||||
// Firebase may not be initialized (e.g., in tests).
|
||||
}
|
||||
}
|
||||
|
||||
return exception;
|
||||
|
||||
Reference in New Issue
Block a user