File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -315,9 +315,17 @@ class BoundHostedSource extends CachedSource {
315
315
/// Always throws an error, either the original one or a better one.
316
316
void _throwFriendlyError (
317
317
error, StackTrace stackTrace, String package, String url) {
318
- if (error is PubHttpException && error.response.statusCode == 404 ) {
319
- throw new PackageNotFoundException (
320
- "Could not find package $package at $url ." , error, stackTrace);
318
+ if (error is PubHttpException ) {
319
+ if (error.response.statusCode == 404 ) {
320
+ throw new PackageNotFoundException (
321
+ "Could not find package $package at $url ." , error, stackTrace);
322
+ }
323
+
324
+ fail (
325
+ "${error .response .statusCode } ${error .response .reasonPhrase } trying "
326
+ "to find package $package at $url ." ,
327
+ error,
328
+ stackTrace);
321
329
}
322
330
323
331
if (error is io.SocketException ) {
You can’t perform that action at this time.
0 commit comments