apiserver: rationalize error handling #3307

Merged
merged 1 commit into from Sep 24, 2015

Conversation

Projects
None yet
2 participants
Owner

rogpeppe commented Sep 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/)

Owner

rogpeppe commented Sep 23, 2015

$$merge$$

Contributor

jujubot commented Sep 23, 2015

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

Contributor

jujubot commented Sep 23, 2015

Build failed: Does not match ['fixes-1488581']
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/4841

Owner

rogpeppe commented Sep 23, 2015

$$merge$$

Contributor

jujubot commented Sep 23, 2015

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

Contributor

jujubot commented Sep 23, 2015

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/4848

Owner

rogpeppe commented Sep 24, 2015

$$merge$$

Contributor

jujubot commented Sep 24, 2015

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

Contributor

jujubot commented Sep 24, 2015

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/4869

apiserver: rationalize error handling
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,
and its error string to all lower case, because that is also standard.
Owner

rogpeppe commented Sep 24, 2015

$$merge$$

Contributor

jujubot commented Sep 24, 2015

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

Contributor

jujubot commented Sep 24, 2015

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/4874

Owner

rogpeppe commented Sep 24, 2015

$$merge$$ !!!

Contributor

jujubot commented Sep 24, 2015

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

jujubot added a commit that referenced this pull request Sep 24, 2015

Merge pull request #3307 from rogpeppe/045-cubs-apiserver-refactor-2
apiserver: rationalize error handling

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/)

@jujubot jujubot merged commit 4a4a2bc into juju:chicago-cubs Sep 24, 2015

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