Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(281)

Issue 55690043: Fix for bug 1225483

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 3 months ago by abel.deuring
Modified:
10 years, 3 months ago
Reviewers:
mp+202699, natefinch
Visibility:
Public.

Description

Fix for bug 1225483 (bug 1225483: "Error when trying to deploy without a network connection isn't user friendly.") Running "juju deploy" without an internet connection fails in CharmStore.Info(), so I modified the error handling of the HTTP request issued there. Two errors are possible: If a DNS lookup is necessary, net.DNSError is raised; if the client machine locally caches DNS, net.OpError is raised, so both errors are "translated" into the new error message. Testing the net.OpError case the naive way is time consuming: I considered to use charm.NewStore("http://192.0.2.0"): The network 192.0.2.0/24 is a testing network, so access to this address indeed laed reliably to an error, but it can be a timeout error -- after 30 seconds or so. (Without an internet connection, one would get an immedieate "no route to host" error). So I copped out from writing a specific test for this case... https://code.launchpad.net/~adeuring/juju-core/1225483/+merge/202699 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -0 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M charm/repo.go View 2 chunks +9 lines, -0 lines 1 comment Download
M charm/repo_test.go View 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 2
abel.deuring
Please take a look.
10 years, 3 months ago (2014-01-22 16:14:14 UTC) #1
natefinch
10 years, 3 months ago (2014-01-22 16:45:56 UTC) #2
LGTM with one slight fix.

https://codereview.appspot.com/55690043/diff/1/charm/repo.go
File charm/repo.go (right):

https://codereview.appspot.com/55690043/diff/1/charm/repo.go#newcode146
charm/repo.go:146: case *net.OpError:
You can combine these cases by making it:
case *net.DNSError, *net.OpError:

That way you don't have to duplicate the message.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b