https://codereview.appspot.com/9830049/diff/1/environs/tools_test.go#newcode171
environs/tools_test.go:171: c.Check(err, DeepEquals,
&errors.NotFoundError{test.err.Error()})
in other tests we do check IsNotFound and the error message rather than
using DeepEquals. would that be better here too?
alternatively we could change those other tests to use this idiom,
which seems fine too.
yes, i seem to remember that in some cases, mongo
does not produce an error code when access is unauthorised.
i believe gustavo filed an issue for that, but
i don't recall where or when.
about the "need to login" error, i don't *think*
we need to check that here, as it should happen only
when setting passwords AFAICS (that error is also checked in
SetAdminMongoPassword BTW), but it's also a similar issue
re: lack of mongo error code.
LGTM with some suggestions. i'd like to lose the stuttering and this
seems like a reasonable CL to do it in.
https:/ /codereview. appspot. com/9830049/ diff/1/ charm/repo. go
File charm/repo.go (right):
https:/ /codereview. appspot. com/9830049/ diff/1/ charm/repo. go#newcode288 RawNotFoundf( "charm %q not found in
charm/repo.go:288: return errors.
repository %q", curl, repoPath)
NotFoundf("charm %q in repository %q", curl, repoPath) ?
https:/ /codereview. appspot. com/9830049/ diff/1/ environs/ openstack/ storage. go openstack/ storage. go (right):
File environs/
https:/ /codereview. appspot. com/9830049/ diff/1/ environs/ openstack/ storage. go#newcode11 openstack/ storage. go:11: coreerrors net/juju- core/errors"
environs/
"launchpad.
looks like this can lose the import alias.
https:/ /codereview. appspot. com/9830049/ diff/1/ environs/ tools_test. go tools_test. go (right):
File environs/
https:/ /codereview. appspot. com/9830049/ diff/1/ environs/ tools_test. go#newcode171 tools_test. go:171: c.Check(err, DeepEquals, NotFoundError{ test.err. Error() })
environs/
&errors.
in other tests we do check IsNotFound and the error message rather than
using DeepEquals. would that be better here too?
alternatively we could change those other tests to use this idiom,
which seems fine too.
https:/ /codereview. appspot. com/9830049/ diff/1/ errors/ errors. go
File errors/errors.go (right):
https:/ /codereview. appspot. com/9830049/ diff/1/ errors/ errors. go#newcode11 errors. go:11: type NotFoundError struct { /NotFound/ ?
errors/
s/NotFoundError
(as discussed)
and ditto for Unauthorized and the Is* functions.
https:/ /codereview. appspot. com/9830049/ diff/1/ state/apiserver /errors_ test.go /errors_ test.go (right):
File state/apiserver
https:/ /codereview. appspot. com/9830049/ diff/1/ state/apiserver /errors_ test.go# newcode26 /errors_ test.go: 26: err: errors. RawNotFoundf( "hello" ),
state/apiserver
no real need to use Raw here, is there?
https:/ /codereview. appspot. com/9830049/ diff/1/ state/open. go
File state/open.go (right):
https:/ /codereview. appspot. com/9830049/ diff/1/ state/open. go#newcode188
state/open.go:188: // error value produced my mongo, or mgo, or
something? And what about
s/my mongo/by mongo/
yes, i seem to remember that in some cases, mongo
does not produce an error code when access is unauthorised.
i believe gustavo filed an issue for that, but
i don't recall where or when.
about the "need to login" error, i don't *think* ssword BTW), but it's also a similar issue
we need to check that here, as it should happen only
when setting passwords AFAICS (that error is also checked in
SetAdminMongoPa
re: lack of mongo error code.
https:/ /codereview. appspot. com/9830049/ diff/1/ testing/ charm.go
File testing/charm.go (right):
https:/ /codereview. appspot. com/9830049/ diff/1/ testing/ charm.go# newcode174 charm.go: 174: return nil, errors. RawNotFoundf( "charm %q not
testing/
found in mock store", charmURL)
NotFoundf("charm %q in mock store", charmURL)
(and below)?
https:/ /codereview. appspot. com/9830049/