Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dart.googlesource.com-pub
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fuchsia-mirror
dart.googlesource.com-pub
Commits
153a67e3
Commit
153a67e3
authored
7 years ago
by
Sergey Kolchenko
Committed by
Natalie Weizenbaum
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Handle http errors trying to find package (#1552)
parent
a6fc90b2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/src/source/hosted.dart
+11
-3
11 additions, 3 deletions
lib/src/source/hosted.dart
with
11 additions
and
3 deletions
lib/src/source/hosted.dart
+
11
−
3
View file @
153a67e3
...
...
@@ -315,9 +315,17 @@ class BoundHostedSource extends CachedSource {
/// Always throws an error, either the original one or a better one.
void
_throwFriendlyError
(
error
,
StackTrace
stackTrace
,
String
package
,
String
url
)
{
if
(
error
is
PubHttpException
&&
error
.
response
.
statusCode
==
404
)
{
throw
new
PackageNotFoundException
(
"Could not find package
$package
at
$url
."
,
error
,
stackTrace
);
if
(
error
is
PubHttpException
)
{
if
(
error
.
response
.
statusCode
==
404
)
{
throw
new
PackageNotFoundException
(
"Could not find package
$package
at
$url
."
,
error
,
stackTrace
);
}
fail
(
"
${error.response.statusCode}
${error.response.reasonPhrase}
trying "
"to find package
$package
at
$url
."
,
error
,
stackTrace
);
}
if
(
error
is
io
.
SocketException
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment