From 487a8907cff49aba0a3fa3e6ec6f43a12ca1c552 Mon Sep 17 00:00:00 2001 From: Nico Mexis Date: Sat, 6 Jan 2024 13:56:22 +0100 Subject: [PATCH] Clean up report mode support checking --- lib/core/catcher_2.dart | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/core/catcher_2.dart b/lib/core/catcher_2.dart index 0a585d8..da1fd0b 100644 --- a/lib/core/catcher_2.dart +++ b/lib/core/catcher_2.dart @@ -534,7 +534,7 @@ class Catcher2 implements ReportModeAction { } if (!isReportModeSupportedInPlatform(report, reportMode)) { _logger.warning( - '$reportMode in not supported for ${report.platformType.name} platform', + '$reportMode is not supported for ${report.platformType.name} platform', ); return; } @@ -557,12 +557,8 @@ class Catcher2 implements ReportModeAction { /// Check if given report mode is enabled in current platform. Only supported /// handlers in given report mode can be used. - bool isReportModeSupportedInPlatform(Report report, ReportMode reportMode) { - if (reportMode.getSupportedPlatforms().isEmpty) { - return false; - } - return reportMode.getSupportedPlatforms().contains(report.platformType); - } + bool isReportModeSupportedInPlatform(Report report, ReportMode reportMode) => + reportMode.getSupportedPlatforms().contains(report.platformType); ReportMode? _getReportModeFromExplicitExceptionReportModeMap(error) { final errorName = error != null ? error.toString().toLowerCase() : '';