Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
apiserver: rationalize error handling #3307
Conversation
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Does not match ['fixes-1488581'] |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ !!! |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
rogpeppe commentedSep 17, 2015
We derive HTTP status codes from errors and consolidate as much of the
error response handling as we can.
The only semantic change in this branch is that the CodeOperationBlocked
error now returns an http.StatusForbidden status code rather than
StatusBadRequest. Given that http status codes are ignored other than
for success/failure, this should have no impact.
In passing, we also change common.ErrOperationBlocked to OperationBlockedError,
because that is the idiomatic form for functions that return new errors,
(Review request: http://reviews.vapour.ws/r/2689/)