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.
*** 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 /codereview. appspot. com/9859045
CC=
https:/
https:/ /codereview. appspot. com/9859045/ diff/1/ cmd/juju/ upgradejuju. go upgradejuju. go (right):
File cmd/juju/
https:/ /codereview. appspot. com/9859045/ diff/1/ cmd/juju/ upgradejuju. go#newcode7 upgradejuju. go:7: "errors"
cmd/juju/
On 2013/05/30 04:19:13, dfc wrote:
> import stderrors "errors"
Done.
https:/ /codereview. appspot. com/9859045/