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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 /** 7 /**
8 * [Link] objects are references to filesystem links. 8 * [Link] objects are references to filesystem links.
9 * 9 *
10 */ 10 */
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 200
201 bool _isErrorResponse(response) { 201 bool _isErrorResponse(response) {
202 return response is List && response[0] != _SUCCESS_RESPONSE; 202 return response is List && response[0] != _SUCCESS_RESPONSE;
203 } 203 }
204 204
205 void _ensureFileService() { 205 void _ensureFileService() {
206 if (_fileService == null) { 206 if (_fileService == null) {
207 _fileService = _FileUtils._newServicePort(); 207 _fileService = _FileUtils._newServicePort();
208 } 208 }
209 } 209 }
210
211 _exceptionFromResponse(response, String message) {
212 assert(_isErrorResponse(response));
213 switch (response[_ERROR_RESPONSE_ERROR_TYPE]) {
214 case _ILLEGAL_ARGUMENT_RESPONSE:
215 return new ArgumentError();
216 case _OSERROR_RESPONSE:
217 var err = new OSError(response[_OSERROR_RESPONSE_MESSAGE],
218 response[_OSERROR_RESPONSE_ERROR_CODE]);
219 return new FileIOException(message, err);
220 case _FILE_CLOSED_RESPONSE:
221 return new FileIOException("File closed");
222 default:
223 return new Exception("Unknown error");
224 }
225 }
210 } 226 }
211 227
212 228
213 class LinkIOException implements Exception { 229 class LinkIOException implements Exception {
214 const LinkIOException([String this.message = "", 230 const LinkIOException([String this.message = "",
215 String this.path = "", 231 String this.path = "",
216 OSError this.osError = null]); 232 OSError this.osError = null]);
217 String toString() { 233 String toString() {
218 StringBuffer sb = new StringBuffer(); 234 StringBuffer sb = new StringBuffer();
219 sb.write("LinkIOException"); 235 sb.write("LinkIOException");
(...skipping 10 matching lines...) Expand all
230 if (path != null) { 246 if (path != null) {
231 sb.write(", path = $path"); 247 sb.write(", path = $path");
232 } 248 }
233 } 249 }
234 return sb.toString(); 250 return sb.toString();
235 } 251 }
236 final String message; 252 final String message;
237 final String path; 253 final String path;
238 final OSError osError; 254 final OSError osError;
239 } 255 }
OLDNEW
« 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