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

Side by Side Diff: sdk/lib/_internal/pub/lib/src/barback/server.dart

Issue 26968003: Remove DirectoryException and LinkException from dart:io and use FileException instaed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge with master. Created 7 years, 1 month 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
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 library pub.barback.server; 5 library pub.barback.server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io'; 9 import 'dart:io';
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // information and so scheduled_test knows we haven't timed out while 102 // information and so scheduled_test knows we haven't timed out while
103 // loading transformers. 103 // loading transformers.
104 _logRequest(request, "Served $id"); 104 _logRequest(request, "Served $id");
105 request.response.close(); 105 request.response.close();
106 }); 106 });
107 }).catchError((error) { 107 }).catchError((error) {
108 _resultsController.add( 108 _resultsController.add(
109 new BarbackServerResult._failure(request.uri, id, error)); 109 new BarbackServerResult._failure(request.uri, id, error));
110 110
111 // If we couldn't read the asset, handle the error gracefully. 111 // If we couldn't read the asset, handle the error gracefully.
112 if (error is FileException) { 112 if (error is FileSystemException) {
113 // Assume this means the asset was a file-backed source asset 113 // Assume this means the asset was a file-backed source asset
114 // and we couldn't read it, so treat it like a missing asset. 114 // and we couldn't read it, so treat it like a missing asset.
115 _notFound(request, error); 115 _notFound(request, error);
116 return; 116 return;
117 } 117 }
118 118
119 var trace = new Trace.from(getAttachedStackTrace(error)); 119 var trace = new Trace.from(getAttachedStackTrace(error));
120 _logRequest(request, "$error\n$trace"); 120 _logRequest(request, "$error\n$trace");
121 121
122 // Otherwise, it's some internal error. 122 // Otherwise, it's some internal error.
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 bool get isSuccess => error == null; 281 bool get isSuccess => error == null;
282 282
283 /// Whether the request was served unsuccessfully. 283 /// Whether the request was served unsuccessfully.
284 bool get isFailure => !isSuccess; 284 bool get isFailure => !isSuccess;
285 285
286 BarbackServerResult._success(this.url, this.id) 286 BarbackServerResult._success(this.url, this.id)
287 : error = null; 287 : error = null;
288 288
289 BarbackServerResult._failure(this.url, this.id, this.error); 289 BarbackServerResult._failure(this.url, this.id, this.error);
290 } 290 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/dartdoc/lib/src/export_map.dart ('k') | sdk/lib/_internal/pub/lib/src/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698