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

Unified Diff: runtime/bin/file.dart

Issue 9630012: Error reporting on File in dart:io (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Style issues 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
« no previous file with comments | « runtime/bin/file.cc ('k') | runtime/bin/file_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file.dart
diff --git a/runtime/bin/file.dart b/runtime/bin/file.dart
index b9d906b9c67a425780e801938fba923376903508..3cc923d81c3bb1121b4a307c1b567c545ffc8329 100644
--- a/runtime/bin/file.dart
+++ b/runtime/bin/file.dart
@@ -204,7 +204,7 @@ interface File default _File {
* Sets the handler that gets called when errors occur during
* operations on this file.
*/
- void set onError(void handler(String error));
+ void set onError(void handler(Exception e));
}
@@ -366,7 +366,21 @@ interface RandomAccessFile {
class FileIOException implements Exception {
- const FileIOException([String this.message = ""]);
- String toString() => "FileIOException: $message";
+ const FileIOException([String this.message = "",
+ OSError this.osError = null]);
+ String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.add("FileIOException");
+ if (!message.isEmpty()) {
+ sb.add(": $message");
+ if (osError != null) {
+ sb.add(" ($osError)");
+ }
+ } else if (osError != null) {
+ sb.add(": osError");
+ }
+ return sb.toString();
+ }
final String message;
+ final OSError osError;
}
« no previous file with comments | « runtime/bin/file.cc ('k') | runtime/bin/file_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698