[openstack-dev] [keystone]Why not common definition about normal HTTP status code like 2xx and 3xx?

Neo Liu diabloneo at gmail.com
Tue Jun 2 10:50:57 UTC 2015


On Tue, Jun 2, 2015 at 5:46 PM Boris Bobrov <bbobrov at mirantis.com> wrote:

> On Tuesday 02 June 2015 09:32:45 Chenhong Liu wrote:
> > There is keystone/exception.py which contains Exceptions defined and used
> > inside keystone provide 4xx and 5xx status code. And we can use it like:
> >     exception.Forbidden.code, exception.forbiddent.title
> >     exception.NotFound.code, exception.NotFound.title
> >
> > This makes the code looks pretty and avoid error prone. But I can't find
> > definition for other status code, like 200, 201, 204, 302, and so on. The
> > code in keystone, especially the unit test cases,  just write these
> status
> > code and title explicitly.
> >
> > How about add those definitions?
>
> These are standard HTTP codes:
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
>
> Description in exceptions is given because one error code can be used for
> several errors. Success codes always have one meaning.
>

I know HTTP codes. I mean writing something like module.OK or
module.NoConent is better than writting '200 OK' or '204 No Conent'.


>
> --
> Best regards,
> Boris Bobrov
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150602/fc4e6399/attachment.html>


More information about the OpenStack-dev mailing list