Skip to content

Commit

Permalink
Better logging
Browse files Browse the repository at this point in the history
Fixes #37
  • Loading branch information
ThexXTURBOXx committed Sep 2, 2024
1 parent e1314bb commit e6ae86f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/core/catcher_2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -663,17 +663,17 @@ class Catcher2 implements ReportModeAction {
_logger.warning('Error occurred in $reportHandler: $handlerError');
return true; // Shut up warnings
}).then((result) {
_logger.info('${report.runtimeType} result: $result');
if (!result) {
_logger.warning('$reportHandler failed to report error');
} else {
if (result) {
_logger.info('$reportHandler successfully reported an error');
_cachedReports.remove(report);
} else {
_logger.warning('$reportHandler failed to report an error');
}
}).timeout(
Duration(milliseconds: _currentConfig.handlerTimeout),
onTimeout: () {
_logger.warning(
'$reportHandler failed to report error because of timeout',
'$reportHandler failed to report an error because of timeout',
);
},
);
Expand Down
4 changes: 4 additions & 0 deletions lib/model/report_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ abstract class ReportHandler {

/// Check whether report mode should auto confirm without user confirmation.
bool shouldHandleWhenRejected() => false;

/// Can be overridden to provide more information about this handler.
@override
String toString() => runtimeType.toString();
}

0 comments on commit e6ae86f

Please sign in to comment.