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

Side by Side Diff: sdk/lib/io/file_system_entity.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/file_impl.dart ('k') | sdk/lib/io/http.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.io; 5 part of dart.io;
6 6
7 class FileSystemEntityType { 7 class FileSystemEntityType {
8 static const FILE = const FileSystemEntityType._internal(0); 8 static const FILE = const FileSystemEntityType._internal(0);
9 static const DIRECTORY = const FileSystemEntityType._internal(1); 9 static const DIRECTORY = const FileSystemEntityType._internal(1);
10 static const LINK = const FileSystemEntityType._internal(2); 10 static const LINK = const FileSystemEntityType._internal(2);
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 /** 364 /**
365 * Synchronously checks if typeSync(path) returns 365 * Synchronously checks if typeSync(path) returns
366 * FileSystemEntityType.DIRECTORY. 366 * FileSystemEntityType.DIRECTORY.
367 */ 367 */
368 static bool isDirectorySync(String path) => 368 static bool isDirectorySync(String path) =>
369 (_getTypeSync(path, true) == FileSystemEntityType.DIRECTORY._type); 369 (_getTypeSync(path, true) == FileSystemEntityType.DIRECTORY._type);
370 370
371 371
372 static _throwIfError(Object result, String msg) { 372 static _throwIfError(Object result, String msg) {
373 if (result is OSError) { 373 if (result is OSError) {
374 throw new FileIOException(msg, result); 374 throw new FileException(msg, result);
375 } else if (result is ArgumentError) { 375 } else if (result is ArgumentError) {
376 throw result; 376 throw result;
377 } 377 }
378 } 378 }
379 } 379 }
OLDNEW
« no previous file with comments | « sdk/lib/io/file_impl.dart ('k') | sdk/lib/io/http.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698