Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2178)

Unified Diff: pkg/front_end/lib/src/fasta/problems.dart

Issue 2974933002: Remove deprecated_internalProblem. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/fasta/problems.dart
diff --git a/pkg/front_end/lib/src/fasta/problems.dart b/pkg/front_end/lib/src/fasta/problems.dart
index 71b21bc1c5f5f58249d2ec22b3a6ad1c61319804..891c57028cba53d62b8a8deb2c53ec2aa06b6693 100644
--- a/pkg/front_end/lib/src/fasta/problems.dart
+++ b/pkg/front_end/lib/src/fasta/problems.dart
@@ -16,16 +16,15 @@ import 'messages.dart'
/// Used to report an internal error.
///
/// Internal errors should be avoided as best as possible, but are preferred
-/// over assertion failures. The message should contain a short description
-/// that may help a developer debug the issue. This method should be called
-/// instead of using `throw`, as this allows us to ensure that there are no
-/// throws anywhere else in the codebase.
+/// over assertion failures. The message should start with "Internal error:"
+/// and contain a short description that may help a developer debug the issue.
+/// This method should be called instead of using `throw`, as this allows us to
+/// ensure that there are no throws anywhere else in the codebase.
dynamic internalProblem(Message message, int charOffset, Uri uri) {
- String text = "Internal problem: ${message.message}";
if (uri == null && charOffset == -1) {
- throw text;
+ throw message.message;
} else {
- throw deprecated_format(uri, charOffset, text);
+ throw deprecated_format(uri, charOffset, message.message);
}
}

Powered by Google App Engine
This is Rietveld 408576698