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

Side by Side Diff: runtime/bin/directory.dart

Issue 9630012: Error reporting on File in dart:io (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Style issues Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/directory.cc ('k') | runtime/bin/directory_impl.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** 5 /**
6 * [Directory] objects are used for working with directories. 6 * [Directory] objects are used for working with directories.
7 */ 7 */
8 interface Directory default _Directory { 8 interface Directory default _Directory {
9 /** 9 /**
10 * Creates a directory object. The path is either a full path or 10 * Creates a directory object. The path is either a full path or
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 */ 137 */
138 void set onError(void onError(String error)); 138 void set onError(void onError(String error));
139 139
140 /** 140 /**
141 * Gets the path of this directory. 141 * Gets the path of this directory.
142 */ 142 */
143 final String path; 143 final String path;
144 } 144 }
145 145
146 146
147 class DirectoryException { 147 class DirectoryIOException implements Exception {
148 const DirectoryException([String this.message, int this.errorCode = 0]); 148 const DirectoryIOException([String this.message = "",
149 String toString() => "DirectoryException: $message"; 149 OSError this.osError = null]);
150 String toString() {
151 StringBuffer sb = new StringBuffer();
152 sb.add("DirectoryIOException");
153 if (!message.isEmpty()) {
154 sb.add(": $message");
155 if (osError != null) {
156 sb.add(" ($osError)");
157 }
158 } else if (osError != null) {
159 sb.add(": $osError");
160 }
161 return sb.toString();
162 }
150 final String message; 163 final String message;
151 final int errorCode; 164 final OSError osError;
152 } 165 }
OLDNEW
« no previous file with comments | « runtime/bin/directory.cc ('k') | runtime/bin/directory_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698