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

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

Issue 13775005: Add missing method to link.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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/link.dart
diff --git a/sdk/lib/io/link.dart b/sdk/lib/io/link.dart
index b91ae5a64e5b10fdc2df0337b8fa9fa9649c3194..215e22cbd8d6682665536e5e350fc860393bf7b8 100644
--- a/sdk/lib/io/link.dart
+++ b/sdk/lib/io/link.dart
@@ -207,6 +207,22 @@ class _Link extends FileSystemEntity implements Link {
_fileService = _FileUtils._newServicePort();
}
}
+
+ _exceptionFromResponse(response, String message) {
+ assert(_isErrorResponse(response));
+ switch (response[_ERROR_RESPONSE_ERROR_TYPE]) {
+ case _ILLEGAL_ARGUMENT_RESPONSE:
+ return new ArgumentError();
+ case _OSERROR_RESPONSE:
+ var err = new OSError(response[_OSERROR_RESPONSE_MESSAGE],
+ response[_OSERROR_RESPONSE_ERROR_CODE]);
+ return new FileIOException(message, err);
+ case _FILE_CLOSED_RESPONSE:
+ return new FileIOException("File closed");
+ default:
+ return new Exception("Unknown error");
+ }
+ }
}
« 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