Skip to content

Commit

Permalink
fix: catch and log updateEndpoint error during configure (#3985)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan-Nelson authored and khatruong2009 committed Oct 24, 2023
1 parent 4e8805b commit e5e8d1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import 'utils/mock_secure_storage.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

group('unathenticated access restricted', () {
group(
'Amplify.configure should complete even when unauthenticated access is disabled.',
() {
tearDown(Amplify.reset);

for (final environmentName in const [
Expand All @@ -34,7 +36,7 @@ void main() {
]);
await expectLater(
Amplify.configure(amplifyEnvironments[environmentName]!),
throwsA(isA<UnknownException>()),
completes,
);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ class AmplifyAnalyticsPinpointDart extends AnalyticsPluginInterface {
_endpointClient = analyticsClient.endpointClient;
_eventClient = analyticsClient.eventClient;

await _endpointClient.updateEndpoint();
try {
await _endpointClient.updateEndpoint();
} on Exception catch (e) {
_logger.warn('Could not update endpoint: $e');
}

_sessionManager = SessionManager(
fixedEndpointId: _endpointClient.fixedEndpointId,
Expand Down

0 comments on commit e5e8d1b

Please sign in to comment.