From 99469933642ea7a5753edad754c1976c9fadd6db Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Mon, 18 Jan 2021 23:47:03 +0100 Subject: [PATCH] shouldLogException: Handle all exception types Fixes APP-SB --- lib/core/git_repo.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/core/git_repo.dart b/lib/core/git_repo.dart index 37b8996e..db5edfbf 100644 --- a/lib/core/git_repo.dart +++ b/lib/core/git_repo.dart @@ -284,8 +284,11 @@ const ignoredMessages = [ "failed getting response", ]; -bool shouldLogGitException(GitException ex) { - var msg = ex.cause.toLowerCase(); +bool shouldLogGitException(Exception ex) { + if (ex is! GitException) { + return false; + } + var msg = (ex as GitException).cause.toLowerCase(); for (var i = 0; i < ignoredMessages.length; i++) { if (msg.contains(ignoredMessages[i])) { return false;