Chromium Code Reviews| Index: lib/src/server/assets.dart |
| diff --git a/lib/src/server/assets.dart b/lib/src/server/assets.dart |
| index caf582936141cbfcfd805cc78fecf520ddb36033..04f251a61d44ab72620fa9b9c0c04358d93d1beb 100644 |
| --- a/lib/src/server/assets.dart |
| +++ b/lib/src/server/assets.dart |
| @@ -48,9 +48,8 @@ class AssetsManager { |
| }) |
| .catchError((e) { |
| print("Unable to connect to 'pub serve' for '${request.uri}': $e"); |
|
kevmoo
2014/11/10 21:57:56
Should we get rid of this print statement, too? Or
kustermann
2014/11/11 09:53:13
"stdout" is currently our log for locally testing.
kevmoo
2014/11/11 15:15:52
Done.
|
| - var error = new AssetError( |
| + throw new AssetError( |
| "Unable to connect to 'pub serve' for '${request.uri}': $e"); |
| - return new Future.error(error); |
| }); |
| } |
| @@ -74,10 +73,9 @@ class AssetsManager { |
| if (response.statusCode == HttpStatus.OK) { |
| return response; |
| } else { |
| - var error = new AssetError( |
| + throw new AssetError( |
| "Failed to fetch asset '$path' from pub: " |
| "${response.statusCode}."); |
| - return new Future.error(error); |
| } |
| }) |
| .catchError((error) { |
| @@ -85,7 +83,7 @@ class AssetsManager { |
| error = new AssetError( |
| "Failed to fetch asset '$path' from pub: '${path}': $error"); |
| } |
| - return new Future.error(error); |
| + throw error; |
| }); |
| } |
| @@ -95,8 +93,7 @@ class AssetsManager { |
| if (exists) { |
| return new File(root + path).openRead(); |
| } else { |
| - var error = new AssetError("Asset '$path' not found"); |
| - return new Future.error(error); |
| + throw new AssetError("Asset '$path' not found"); |
| } |
| }); |
| } |