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

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

Issue 13527004: Add comments to the synchronous file methods stating that they throw (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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/io/file.dart ('k') | tests/standalone/io/file_error_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/file_impl.dart
diff --git a/sdk/lib/io/file_impl.dart b/sdk/lib/io/file_impl.dart
index 8ab05f6c5730b2b22159d85da821d1e590107d1a..6da4d9f4f2c0ddf5b412a19a544c0d58e2ef0bee 100644
--- a/sdk/lib/io/file_impl.dart
+++ b/sdk/lib/io/file_impl.dart
@@ -698,11 +698,17 @@ class _RandomAccessFile extends _FileBase implements RandomAccessFile {
external static _read(int id, int bytes);
List<int> readSync(int bytes) {
+ _checkNotClosed();
if (bytes is !int) {
throw new FileIOException(
"Invalid arguments to readSync for file '$_path'");
}
- return _read(_id, bytes);
+ var result = _read(_id, bytes);
+ if (result is OSError) {
+ throw new FileIOException("readSync failed for file '$_path'",
+ result);
+ }
+ return result;
}
Future<int> readList(List<int> buffer, int offset, int bytes) {
« no previous file with comments | « sdk/lib/io/file.dart ('k') | tests/standalone/io/file_error_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698