Skip to content

Commit

Permalink
chore: added ignore line for try catch block and removed unnecessary …
Browse files Browse the repository at this point in the history
…method
  • Loading branch information
khatruong2009 committed Aug 31, 2023
1 parent c7454ed commit 3741ecd
Showing 1 changed file with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,6 @@ class DefaultRemoteLoggingConstraintProvider
await file.writeAsString(jsonEncode(constraint));
}

Future<LoggingConstraint?> _getConstraintFromLocalStorage() async {
final file = File('logging_constraint.json');
if (await file.exists()) {
final content = await file.readAsString();
return LoggingConstraint.fromJson(
jsonDecode(content) as Map<String, dynamic>,
);
}
return null;
}

Future<void> _fetchAndCacheConstraintFromEndpoint() async {
try {
final constraint = await _fetchConstraintFromEndpoint();
Expand All @@ -76,6 +65,7 @@ class DefaultRemoteLoggingConstraintProvider
_lastUpdated = DateTime.now();
await _saveConstraintLocally(constraint);
}
// ignore: avoid_catches_without_on_clauses
} catch (error) {
_logger.debug('Error fetching constraints: $error');
}
Expand Down

0 comments on commit 3741ecd

Please sign in to comment.