Index: sdk/lib/io/file.dart |
diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart |
index d48a367005e572cd5daaf9959f83ff27c02e89ac..2f8a01d3192624255eaa751190d90b07bf1ad559 100644 |
--- a/sdk/lib/io/file.dart |
+++ b/sdk/lib/io/file.dart |
@@ -561,10 +561,34 @@ abstract class RandomAccessFile { |
} |
+/** |
+ * Exception thrown when a file operation fails. |
+ */ |
class FileSystemException implements IOException { |
+ /** |
+ * Message describing the error. This does not include any detailed |
+ * information form the underlying OS error. Check [osError] for |
+ * that information. |
+ */ |
final String message; |
+ |
+ /** |
+ * The file system path on which the error occurred. Can be `null` |
+ * if the exception does not relate directly to a file system path. |
+ */ |
final String path; |
+ |
+ /** |
+ * The underlying OS error. Can be `null` if the exception is not |
+ * raised due to an OS error. |
+ */ |
final OSError osError; |
+ |
+ /** |
+ * Creates a new FileSystemException with an optional error message |
+ * [message], optional file system path [path] and OS error |
Anders Johnsen
2014/01/10 08:48:43
optional OS error
Søren Gjesse
2014/01/10 11:44:20
Done.
|
+ * [osError]. |
+ */ |
const FileSystemException([this.message = "", this.path = "", this.osError]); |
String toString() { |
@@ -579,10 +603,12 @@ class FileSystemException implements IOException { |
sb.write(" ($osError)"); |
} |
} else if (osError != null) { |
- sb.write(": osError"); |
+ sb.write(": $osError"); |
if (path != null) { |
sb.write(", path = $path"); |
Anders Johnsen
2014/01/10 08:48:43
' around $path. (and above)
Søren Gjesse
2014/01/10 11:44:20
Done.
|
} |
+ } else if (path != null) { |
+ sb.write(": $path"); |
} |
return sb.toString(); |
} |