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

Unified Diff: runtime/bin/directory.dart

Issue 9630012: Error reporting on File in dart:io (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased and implemented on all platforms Created 8 years, 9 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: runtime/bin/directory.dart
diff --git a/runtime/bin/directory.dart b/runtime/bin/directory.dart
index dd6bf149d09667dd7117d7b1fec2f7e547a691a6..bf47f770c3ecd5e041d10c8d7a0d8c28525d44fd 100644
--- a/runtime/bin/directory.dart
+++ b/runtime/bin/directory.dart
@@ -144,9 +144,22 @@ interface Directory default _Directory {
}
-class DirectoryException {
- const DirectoryException([String this.message, int this.errorCode = 0]);
- String toString() => "DirectoryException: $message";
+class DirectoryIOException implements Exception {
+ const DirectoryIOException([String this.message = "",
+ OSError this.osError = null]);
+ String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.add("DirectoryIOException");
+ if (message != null) {
Mads Ager (google) 2012/03/13 10:56:17 !message.isEmpty()?
Søren Gjesse 2012/03/13 12:39:49 Done.
+ sb.add(": $message");
+ if (osError != null) {
+ sb.add(" (${osError.toString()})");
+ }
+ } else if (osError != null) {
+ sb.add(": ${osError.toString()}");
+ }
+ return sb.toString();
+ }
final String message;
- final int errorCode;
+ final OSError osError;
}

Powered by Google App Engine
This is Rietveld 408576698