Index: runtime/bin/file.dart |
diff --git a/runtime/bin/file.dart b/runtime/bin/file.dart |
index 9728ab7cd92d338429781fb34974419b3fc74f25..c2eea0d4ec4694b84e13f2b491a3d58024dee770 100644 |
--- a/runtime/bin/file.dart |
+++ b/runtime/bin/file.dart |
@@ -365,7 +365,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) { |
+ 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 OSError osError; |
} |