Skip to content

Commit

Permalink
Improve test so that snippet is displayed when an exception is thrown
Browse files Browse the repository at this point in the history
Change-Id: Ib5a7ed985df42b7d56dd98e104a145fddc895599
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105020
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
  • Loading branch information
bwilkerson authored and commit-bot@chromium.org committed Jun 5, 2019
1 parent 788dcf6 commit 37976dd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/analyzer/test/verify_docs_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ $snippet
writeError(error, importsLength);
}
}
} catch (exception, stackTrace) {
if (output.isNotEmpty) {
output.writeln();
}
output.writeln('Exception while analyzing "$snippet"');
output.writeln();
output.writeln(exception);
output.writeln(stackTrace);
} finally {
provider.removeOverlay(snippetPath);
}
Expand Down

0 comments on commit 37976dd

Please sign in to comment.