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

Unified Diff: sdk/lib/_internal/pub/lib/src/exceptions.dart

Issue 372123002: Get rid of deferred binding for usage errors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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: sdk/lib/_internal/pub/lib/src/exceptions.dart
diff --git a/sdk/lib/_internal/pub/lib/src/exceptions.dart b/sdk/lib/_internal/pub/lib/src/exceptions.dart
index 7bbbb34faea9ab406714923f0038dfb449f3ae50..74af539763f4e7a9b7306ec00384c177d56dd157 100644
--- a/sdk/lib/_internal/pub/lib/src/exceptions.dart
+++ b/sdk/lib/_internal/pub/lib/src/exceptions.dart
@@ -53,23 +53,10 @@ class UsageException extends ApplicationException {
/// The command usage information.
String _usage;
- UsageException(String message)
+ UsageException(String message, this._usage)
: super(message);
- String toString() {
- if (_usage == null) return message;
- return "$message\n\n$_usage";
- }
-
- /// Attach usage information to the exception.
- ///
- /// This is done after the exception is created so that code outside of the
- /// command can still generate usage errors.
- void bindUsage(String usage) {
- // Only bind if not already bound.
- if (_usage != null) return;
- _usage = usage;
- }
+ String toString() => "$message\n\n$_usage";
}
/// A class for errors in a command's input data.

Powered by Google App Engine
This is Rietveld 408576698