apiserver/common: standardise on juju/errors #4591

Merged
merged 1 commit into from Mar 2, 2016

Conversation

Projects
None yet
2 participants
Contributor

davecheney commented Mar 2, 2016

common/errors.go imported both the go errors package, and our
juju/errors superset. This was so sentinel errors were created without
the usual juju/errors file/line tracking.

This is unncessary, juju/errors.New is fully compatible with errors.New;
its sentinel values can still be compared by value.

The only visible change is the error trace, rather that listing no
file/ilne for the final error value, it will list the file/line that the
value was declared at the package level. This distinction is not
important, because what we look for in the error trace is not where the
error was created, but who was the caller -- if we wanted the former,
sentinal errors are not the right tool.

(Review request: http://reviews.vapour.ws/r/4031/)

apiserver/common: standardise on juju/errors
common/errors.go imported both the go errors package, and our
juju/errors superset. This was so sentinel errors were created without
the usual juju/errors file/line tracking.

This is unncessary, juju/errors.New is fully compatible with errors.New;
its sentinel values can still be compared by value.

The only visible change is the error trace, rather that listing no
file/ilne for the final error value, it will list the file/line that the
value was declared at the package level. This distinction is not
important, because what we look for in the error trace is not where the
error was created, but who was the caller -- if we wanted the former,
sentinal errors are not the right tool.
Contributor

davecheney commented Mar 2, 2016

$$JFDI$$

Contributor

jujubot commented Mar 2, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

jujubot added a commit that referenced this pull request Mar 2, 2016

Merge pull request #4591 from davecheney/apiserver-common-errors-driveby
apiserver/common: standardise on juju/errors

common/errors.go imported both the go errors package, and our
juju/errors superset. This was so sentinel errors were created without
the usual juju/errors file/line tracking.

This is unncessary, juju/errors.New is fully compatible with errors.New;
its sentinel values can still be compared by value.

The only visible change is the error trace, rather that listing no
file/ilne for the final error value, it will list the file/line that the
value was declared at the package level. This distinction is not
important, because what we look for in the error trace is not where the
error was created, but who was the caller -- if we wanted the former,
sentinal errors are not the right tool.

(Review request: http://reviews.vapour.ws/r/4031/)

@jujubot jujubot merged commit 92376a1 into juju:master Mar 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment