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

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

Issue 16123036: Clean up dart:io exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 | « sdk/lib/_internal/pub/lib/src/utils.dart ('k') | sdk/lib/io/directory.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/common.dart
diff --git a/sdk/lib/io/common.dart b/sdk/lib/io/common.dart
index 3fcee6277a14eb8dbae0a34b5d0a18eddb5c74dc..31ce72b6c9232096c18104b1a907dc6bc4204972 100644
--- a/sdk/lib/io/common.dart
+++ b/sdk/lib/io/common.dart
@@ -31,19 +31,26 @@ _exceptionFromResponse(response, String message) {
case _OSERROR_RESPONSE:
var err = new OSError(response[_OSERROR_RESPONSE_MESSAGE],
response[_OSERROR_RESPONSE_ERROR_CODE]);
- return new FileIOException(message, err);
+ return new FileException(message, err);
case _FILE_CLOSED_RESPONSE:
- return new FileIOException("File closed");
+ return new FileException("File closed");
default:
return new Exception("Unknown error");
}
}
/**
+ * Base class for all IO related exceptions.
+ */
+abstract class IOException implements Exception {
+ String toString() => "IOException";
+}
+
+/**
* An [OSError] object holds information about an error from the
* operating system.
*/
-class OSError implements Error {
+class OSError {
/** Constant used to indicate that no OS error code is available. */
static const int noErrorCode = -1;
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/utils.dart ('k') | sdk/lib/io/directory.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698