diff --git a/dev/bots/analyze.dart b/dev/bots/analyze.dart index 4376bc7c6c..71d4647d9e 100644 --- a/dev/bots/analyze.dart +++ b/dev/bots/analyze.dart @@ -1086,13 +1086,9 @@ Future verifyNoBinaries(String workingDirectory, { Set grandfathe try { utf8.decode(bytes); } on FormatException catch (error) { - if (error.message.startsWith('Bad UTF-8 encoding ')) { - final Digest digest = sha256.convert(bytes); - if (!grandfatheredBinaries.contains(Hash256.fromDigest(digest))) - problems.add('${file.path}:${error.offset}: file is not valid UTF-8'); - } else { - rethrow; - } + final Digest digest = sha256.convert(bytes); + if (!grandfatheredBinaries.contains(Hash256.fromDigest(digest))) + problems.add('${file.path}:${error.offset}: file is not valid UTF-8'); } } if (problems.isNotEmpty) {