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

Unified Diff: sdk/lib/io/file.dart

Issue 131583004: Add documentation to the FileSystemException class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 6 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/file.dart
diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart
index d48a367005e572cd5daaf9959f83ff27c02e89ac..9bba4be19ca353e5bc6e62afbe673bdfb370dba4 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 optional OS error
+ * [osError].
+ */
const FileSystemException([this.message = "", this.path = "", this.osError]);
String toString() {
@@ -573,16 +597,18 @@ class FileSystemException implements IOException {
if (!message.isEmpty) {
sb.write(": $message");
if (path != null) {
- sb.write(", path = $path");
+ sb.write(", path = '$path'");
}
if (osError != null) {
sb.write(" ($osError)");
}
} else if (osError != null) {
- sb.write(": osError");
+ sb.write(": $osError");
if (path != null) {
- sb.write(", path = $path");
+ sb.write(", path = '$path'");
}
+ } else if (path != null) {
+ sb.write(": $path");
}
return sb.toString();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698