@@ -2475,9 +2475,9 @@ class ExceptionHandlingDelegatingAstVisitor<T> extends DelegatingAstVisitor<T> {
24752475 buffer.write (currentNode.runtimeType);
24762476 currentNode = currentNode.parent;
24772477 }
2478+ // TODO(39284): should this exception be silent?
24782479 AnalysisEngine .instance.instrumentationService.logException (
2479- new CaughtException .withMessage (
2480- buffer.toString (), exception, stackTrace));
2480+ new SilentException (buffer.toString (), exception, stackTrace));
24812481 }
24822482}
24832483
@@ -2531,8 +2531,9 @@ class NodeLocator extends UnifyingAstVisitor<void> {
25312531 try {
25322532 node.accept (this );
25332533 } catch (exception, stackTrace) {
2534+ // TODO(39284): should this exception be silent?
25342535 AnalysisEngine .instance.instrumentationService.logException (
2535- new CaughtException . withMessage (
2536+ new SilentException (
25362537 "Unable to locate element at offset ($_startOffset - $_endOffset )" ,
25372538 exception,
25382539 stackTrace));
@@ -2571,8 +2572,9 @@ class NodeLocator extends UnifyingAstVisitor<void> {
25712572 } catch (exception, stackTrace) {
25722573 // Ignore the exception and proceed in order to visit the rest of the
25732574 // structure.
2575+ // TODO(39284): should this exception be silent?
25742576 AnalysisEngine .instance.instrumentationService.logException (
2575- new CaughtException . withMessage (
2577+ new SilentException (
25762578 "Exception caught while traversing an AST structure." ,
25772579 exception,
25782580 stackTrace));
@@ -2631,8 +2633,9 @@ class NodeLocator2 extends UnifyingAstVisitor<void> {
26312633 try {
26322634 node.accept (this );
26332635 } catch (exception, stackTrace) {
2636+ // TODO(39284): should this exception be silent?
26342637 AnalysisEngine .instance.instrumentationService.logException (
2635- new CaughtException . withMessage (
2638+ new SilentException (
26362639 "Unable to locate element at offset ($_startOffset - $_endOffset )" ,
26372640 exception,
26382641 stackTrace));
@@ -2671,8 +2674,9 @@ class NodeLocator2 extends UnifyingAstVisitor<void> {
26712674 } catch (exception, stackTrace) {
26722675 // Ignore the exception and proceed in order to visit the rest of the
26732676 // structure.
2677+ // TODO(39284): should this exception be silent?
26742678 AnalysisEngine .instance.instrumentationService.logException (
2675- new CaughtException . withMessage (
2679+ new SilentException (
26762680 "Exception caught while traversing an AST structure." ,
26772681 exception,
26782682 stackTrace));
0 commit comments