Index: runtime/bin/file.dart |
diff --git a/runtime/bin/file.dart b/runtime/bin/file.dart |
index b9d906b9c67a425780e801938fba923376903508..a37581ab9f5ced6c5914063e77da276af9a7e933 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 != 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()})"); |
Mads Ager (google)
2012/03/13 10:56:17
You shouldn't have to explictly call toString here
Søren Gjesse
2012/03/13 12:39:49
Done.
|
+ } |
+ } else if (osError != null) { |
+ sb.add(": ${osError.toString()}"); |
Mads Ager (google)
2012/03/13 10:56:17
Ditto.
Søren Gjesse
2012/03/13 12:39:49
Done.
|
+ } |
+ return sb.toString(); |
+ } |
final String message; |
+ final OSError osError; |
} |