diff --git a/lib/apis/git.dart b/lib/apis/git.dart index 4dbd1ee1..81d736a3 100644 --- a/lib/apis/git.dart +++ b/lib/apis/git.dart @@ -9,11 +9,20 @@ import 'package:flutter_crashlytics/flutter_crashlytics.dart'; const _platform = const MethodChannel('gitjournal.io/git'); +bool shouldIgnorePlatformException(PlatformException ex) { + if (ex.message.contains("failed to resolve address for")) { + return true; + } + return false; +} + Future invokePlatformMethod(String method, [dynamic arguments]) async { try { return await _platform.invokeMethod(method, arguments); } on PlatformException catch (e, stacktrace) { - await FlutterCrashlytics().logException(e, stacktrace); + if (!shouldIgnorePlatformException(e)) { + await FlutterCrashlytics().logException(e, stacktrace); + } throw e; } }