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

Unified Diff: sdk/lib/_internal/pub/lib/src/barback/barback_server.dart

Issue 219733002: Make a slightly better 404 page for pub serve. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/barback/base_server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/barback/barback_server.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/barback_server.dart b/sdk/lib/_internal/pub/lib/src/barback/barback_server.dart
index bae6e8062488e1783659f0dc8f9a07d33adcd743..db4158d51379f27c7a54cea6962b245a22383a07 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/barback_server.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/barback_server.dart
@@ -113,13 +113,15 @@ class BarbackServer extends BaseServer<BarbackServerResult> {
} on FormatException catch (ex) {
// If we got here, we had a path like "/packages" which is a special
// directory, but not a valid path since it lacks a following package name.
- notFound(request, ex.message);
+ notFound(request, error: ex.message);
return;
}
// See if the asset should be blocked.
if (allowAsset != null && !allowAsset(id)) {
- notFound(request, "Asset $id is not available in this configuration.");
+ notFound(request,
+ error: "Asset $id is not available in this configuration.",
+ asset: id);
return;
}
@@ -156,7 +158,7 @@ class BarbackServer extends BaseServer<BarbackServerResult> {
}
addResult(new BarbackServerResult._failure(request.uri, id, error));
- notFound(request, error);
+ notFound(request, asset: id);
});
}
@@ -200,7 +202,7 @@ class BarbackServer extends BaseServer<BarbackServerResult> {
if (error is FileSystemException) {
// Assume this means the asset was a file-backed source asset
// and we couldn't read it, so treat it like a missing asset.
- notFound(request, error);
+ notFound(request, error: error.toString(), asset: asset.id);
return;
}
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/barback/base_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698