Merge lp://staging/~wallyworld/juju-core/consolidate-common-errors into lp://staging/~juju/juju-core/trunk
Proposed by
Ian Booth
Status: | Merged |
---|---|
Approved by: | William Reade |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1244 |
Proposed branch: | lp://staging/~wallyworld/juju-core/consolidate-common-errors |
Merge into: | lp://staging/~juju/juju-core/trunk |
Diff against target: |
2527 lines (+319/-252) 70 files modified
cmd/juju/upgradejuju.go (+2/-1) cmd/jujud/agent.go (+2/-1) cmd/jujud/agent_test.go (+2/-1) cmd/jujud/bootstrap_test.go (+3/-2) cmd/jujud/machine_test.go (+2/-1) cmd/jujud/unit_test.go (+2/-1) cmd/jujud/upgrade.go (+2/-1) environs/agent/agent.go (+2/-1) environs/dummy/storage.go (+2/-1) environs/ec2/ec2.go (+2/-1) environs/ec2/live_test.go (+2/-1) environs/ec2/storage.go (+2/-1) environs/imagemetadata/simplestreams.go (+8/-9) environs/interface.go (+0/-14) environs/jujutest/livetests.go (+5/-4) environs/jujutest/tests.go (+2/-1) environs/local/storage.go (+2/-1) environs/local/storage_test.go (+2/-1) environs/maas/environ_test.go (+4/-3) environs/maas/state_test.go (+2/-2) environs/maas/storage.go (+3/-3) environs/maas/storage_test.go (+4/-3) environs/openstack/provider.go (+2/-1) environs/openstack/storage.go (+6/-6) environs/storage.go (+2/-1) environs/tools.go (+2/-1) environs/tools_test.go (+5/-4) errors/errors.go (+66/-0) juju/conn.go (+3/-2) state/apiserver/api_test.go (+2/-1) state/apiserver/apierror.go (+3/-2) state/apiserver/client_test.go (+2/-1) state/apiserver/errors_test.go (+3/-2) state/apiserver/machine_test.go (+4/-3) state/apiserver/user.go (+2/-1) state/charm_test.go (+2/-1) state/constraints.go (+2/-1) state/environ.go (+2/-1) state/initialize_test.go (+4/-3) state/machine.go (+4/-3) state/machine_test.go (+3/-2) state/open.go (+4/-28) state/relation.go (+4/-3) state/relation_test.go (+7/-6) state/relationunit.go (+2/-1) state/relationunit_test.go (+2/-1) state/service.go (+5/-4) state/service_test.go (+16/-15) state/settings.go (+4/-3) state/settings_test.go (+3/-2) state/state.go (+10/-31) state/state_test.go (+15/-14) state/statecmd/destroyrelation_test.go (+4/-4) state/status.go (+2/-1) state/tools_test.go (+2/-1) state/unit.go (+14/-13) state/unit_test.go (+8/-7) state/user.go (+2/-1) state/watcher.go (+2/-1) worker/deployer/deployer.go (+2/-1) worker/deployer/deployer_test.go (+2/-1) worker/firewaller/firewaller.go (+12/-11) worker/machiner/machiner.go (+3/-2) worker/provisioner/provisioner.go (+2/-1) worker/provisioner/provisioner_test.go (+2/-1) worker/uniter/filter.go (+3/-2) worker/uniter/modes.go (+2/-1) worker/uniter/relationer_test.go (+2/-1) worker/uniter/uniter.go (+3/-2) worker/uniter/uniter_test.go (+4/-3) |
To merge this branch: | bzr merge lp://staging/~wallyworld/juju-core/consolidate-common-errors |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+166415@code.staging.launchpad.net |
Description of the change
Consolidate common error code
I need to do some work which involves using an UnauthorisedError. There's
one defined, but on the state package. There's also two different NotFound
error implementation - one in state and one in environs. These errors, and
possibly others, should be in a common, generic package so they can be used
across the code base. I've created an errors packge and moved the structs
and associated help methods there eg IsNotFoundError(), NotFoundf() etc.
The changes are just mechanical and eliminate existing duplicate code.
But now in the next branch, I can reuse UnauthorisedError and avoid
defining another instance of this error.
To post a comment you must log in.
Reviewers: mp+166415_ code.launchpad. net,
Message:
Please take a look.
Description:
Consolidate common error code
I need to do some work which involves using an UnauthorisedError.
There's
one defined, but on the state package. There's also two different
NotFound
error implementation - one in state and one in environs. These errors,
and
possibly others, should be in a common, generic package so they can be
used
across the code base. I've created an errors packge and moved the
structs
and associated help methods there eg IsNotFoundError(), NotFoundf() etc.
The changes are just mechanical and eliminate existing duplicate code.
But now in the next branch, I can reuse UnauthorisedError and avoid
defining another instance of this error.
https:/ /code.launchpad .net/~wallyworl d/juju- core/consolidat e-common- errors/ +merge/ 166415
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/9859045/
Affected files: upgradejuju. go agent_test. go bootstrap_ test.go machine_ test.go unit_test. go upgrade. go agent/agent. go dummy/storage. go ec2/live_ test.go ec2/storage. go imagemetadata/ simplestreams. go interface. go jujutest/ livetests. go jujutest/ tests.go local/storage. go local/storage_ test.go maas/environ_ test.go maas/state_ test.go maas/storage. go maas/storage_ test.go openstack/ provider. go openstack/ storage. go tools_test. go /api_test. go /apierror. go /client_ test.go /errors_ test.go /machine_ test.go /user.go ts.go e_test. go test.go test.go nit.go nit_test. go test.go test.go destroyrelation _test.go deployer/ deployer. go deployer/ deployer_ test.go firewaller/ firewaller. go machiner/ machiner. go provisioner/ provisioner. go provisioner/ provisioner_ test.go uniter/ filter. go uniter/ modes.go uniter/ relationer_ test.go uniter/ uniter. go uniter/ uniter_ test.go
A [revision details]
M cmd/juju/
M cmd/jujud/agent.go
M cmd/jujud/
M cmd/jujud/
M cmd/jujud/
M cmd/jujud/
M cmd/jujud/
M environs/
M environs/
M environs/ec2/ec2.go
M environs/
M environs/
M environs/
M environs/
M environs/
M environs/
M environs/
M environs/
M environs/
M environs/
M environs/
M environs/
M environs/
M environs/
M environs/storage.go
M environs/tools.go
M environs/
A errors/errors.go
M juju/conn.go
M state/apiserver
M state/apiserver
M state/apiserver
M state/apiserver
M state/apiserver
M state/apiserver
M state/charm_test.go
M state/constrain
M state/environ.go
M state/initializ
M state/machine.go
M state/machine_
M state/open.go
M state/relation.go
M state/relation_
M state/relationu
M state/relationu
M state/service.go
M state/service_
M state/settings.go
M state/settings_
M state/state.go
M state/state_test.go
M state/statecmd/
M state/status.go
M state/tools_test.go
M state/unit.go
M state/unit_test.go
M state/user.go
M state/watcher.go
M worker/
M worker/
M worker/
M worker/
M worker/
M worker/
M worker/
M worker/
M worker/
M worker/
M worker/