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

Side by Side Diff: packages/dart_style/test/regression/0300/0370.stmt

Issue 1521693002: Roll Observatory deps (charted -> ^0.3.0) (Closed) Base URL: https://chromium.googlesource.com/external/github.com/dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years 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
OLDNEW
1 >>> 1 >>>
2 return environment.barback.getAssetById(id).then((result) { 2 return environment.barback.getAssetById(id).then((result) {
3 return result; 3 return result;
4 }).then((asset) => _serveAsset(request, asset)).catchError( 4 }).then((asset) => _serveAsset(request, asset)).catchError(
5 (error, 5 (error,
6 trace) { 6 trace) {
7 if (error is! AssetNotFoundException) throw error; 7 if (error is! AssetNotFoundException) throw error;
8 return environment.barback 8 return environment.barback
9 .getAssetById(id.addExtension("/index.html")) 9 .getAssetById(id.addExtension("/index.html"))
10 .then((asset) { 10 .then((asset) {
(...skipping 18 matching lines...) Expand all
29 29
30 addError(error, trace); 30 addError(error, trace);
31 close(); 31 close();
32 return new shelf.Response.internalServerError(); 32 return new shelf.Response.internalServerError();
33 } 33 }
34 34
35 addResult(new BarbackServerResult._failure(request.url, id, error)); 35 addResult(new BarbackServerResult._failure(request.url, id, error));
36 return notFound(request, asset: id); 36 return notFound(request, asset: id);
37 }); 37 });
38 <<< 38 <<<
39 return environment.barback.getAssetById(id).then((result) { 39 return environment.barback
40 return result; 40 .getAssetById(id)
41 }).then((asset) => _serveAsset(request, asset)).catchError((error, trace) { 41 .then((result) {
42 if (error is! AssetNotFoundException) throw error; 42 return result;
43 return environment.barback 43 })
44 .getAssetById(id.addExtension("/index.html")) 44 .then((asset) => _serveAsset(request, asset))
45 .then((asset) { 45 .catchError((error, trace) {
46 if (request.url.path.endsWith('/')) return _serveAsset(request, asset); 46 if (error is! AssetNotFoundException) throw error;
47 return environment.barback
48 .getAssetById(id.addExtension("/index.html"))
49 .then((asset) {
50 if (request.url.path.endsWith('/')) return _serveAsset(request, asset);
47 51
48 // We only want to serve index.html if the URL explicitly ends in a 52 // We only want to serve index.html if the URL explicitly ends in a
49 // slash. For other URLs, we redirect to one with the slash added to 53 // slash. For other URLs, we redirect to one with the slash added to
50 // implicitly support that too. This follows Apache's behavior. 54 // implicitly support that too. This follows Apache's behavior.
51 logRequest(request, "302 Redirect to ${request.url}/"); 55 logRequest(request, "302 Redirect to ${request.url}/");
52 return new shelf.Response.found('${request.url}/'); 56 return new shelf.Response.found('${request.url}/');
53 }).catchError((newError, newTrace) { 57 }).catchError((newError, newTrace) {
54 // If we find neither the original file or the index, we should report 58 // If we find neither the original file or the index, we should report
55 // the error about the original to the user. 59 // the error about the original to the user.
56 throw newError is AssetNotFoundException ? error : newError; 60 throw newError is AssetNotFoundException ? error : newError;
57 }); 61 });
58 }).catchError((error, trace) { 62 })
59 if (error is! AssetNotFoundException) { 63 .catchError((error, trace) {
60 trace = new Chain.forTrace(trace); 64 if (error is! AssetNotFoundException) {
61 logRequest(request, "$error\n$trace"); 65 trace = new Chain.forTrace(trace);
66 logRequest(request, "$error\n$trace");
62 67
63 addError(error, trace); 68 addError(error, trace);
64 close(); 69 close();
65 return new shelf.Response.internalServerError(); 70 return new shelf.Response.internalServerError();
66 } 71 }
67 72
68 addResult(new BarbackServerResult._failure(request.url, id, error)); 73 addResult(new BarbackServerResult._failure(request.url, id, error));
69 return notFound(request, asset: id); 74 return notFound(request, asset: id);
70 }); 75 });
OLDNEW
« no previous file with comments | « packages/dart_style/test/regression/0300/0367.stmt ('k') | packages/dart_style/test/regression/0300/0373.unit » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698