Code review comment for lp://staging/~wallyworld/juju-core/consolidate-common-errors

Revision history for this message
Ian Booth (wallyworld) wrote :

*** Submitted:

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.

R=jameinel, dfc
CC=
https://codereview.appspot.com/9859045

https://codereview.appspot.com/9859045/diff/1/cmd/juju/upgradejuju.go
File cmd/juju/upgradejuju.go (right):

https://codereview.appspot.com/9859045/diff/1/cmd/juju/upgradejuju.go#newcode7
cmd/juju/upgradejuju.go:7: "errors"
On 2013/05/30 04:19:13, dfc wrote:
> import stderrors "errors"

Done.

https://codereview.appspot.com/9859045/

« Back to merge proposal