File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ class Debugger extends Domain {
54
54
final Locations _locations;
55
55
final SkipLists _skipLists;
56
56
57
+ int _frameErrorCount = 0 ;
58
+
57
59
Debugger ._(
58
60
this ._remoteDebugger,
59
61
this ._streamNotify,
@@ -465,15 +467,23 @@ class Debugger extends Domain {
465
467
try {
466
468
dartFrame.vars = await variablesFor (frame);
467
469
} catch (e) {
468
- logger.warning (
469
- 'Error calculating Dart variables for frame $frameIndex : $e ' ,
470
- );
470
+ _frameErrorCount++ ;
471
471
}
472
472
}
473
473
474
474
return dartFrame;
475
475
}
476
476
477
+ /// Can be called after [calculateDartFrameFor] to log any errors.
478
+ void logAnyFrameErrors ({required String frameType}) {
479
+ if (_frameErrorCount > 0 ) {
480
+ logger.warning (
481
+ 'Error calculating Dart variables for $_frameErrorCount $frameType frames.' ,
482
+ );
483
+ }
484
+ _frameErrorCount = 0 ;
485
+ }
486
+
477
487
void _scriptParsedHandler (ScriptParsedEvent e) {
478
488
final scriptPath = _pathForChromeScript (e.script.url);
479
489
if (scriptPath != null ) {
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ class FrameComputer {
73
73
logger.warning ('Error calculating sync frame: $e ' );
74
74
}
75
75
}
76
+ debugger.logAnyFrameErrors (frameType: 'sync' );
76
77
}
77
78
78
79
Future <void > _collectAsyncFrames ({int ? limit}) async {
@@ -129,6 +130,7 @@ class FrameComputer {
129
130
logger.warning ('Error calculating async frame: $e ' );
130
131
}
131
132
}
133
+ debugger.logAnyFrameErrors (frameType: 'async' );
132
134
}
133
135
134
136
// Async frames are no longer on the stack - we don't have local variable
You can’t perform that action at this time.
0 commit comments