git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[keystone][placement][neutron][api-sig] http404 to NotFound, or how should a http json error body look like?


On Mon, 20 May 2019, Colleen Murphy wrote:

>>> Make keystoneauth1 interpret two diferent types of errors response:
>>> the one it does, and the one in the api-sig guidelines. Note that
>>> I've yet to see any context where there is more than one error in
>>> the list, so it is always errors[0] that gets inspected.
>
> We'll happily accept patches to keystoneauth that make it compliant with the API-SIG's guidelines (as long as it is backwards compatible).
>
> I gotta say, though, this guideline on error handling really takes me aback. Why should a single HTTP request ever result in a list of errors, plural? Is there any standard, pattern, or example *outside* of OpenStack where this is done or recommended? Why?

I can't remember the exact details (it was 4 years ago [1]) but I
think the rationale was that if there was a call behind the call it
would be useful and important to be able to report a stack of
errors: I called neutron and it failed like this, and I failed as a
result of that failure, like this.

I agree it is a bit weird but it seems the guideline had some
acclaim at the time so...

Ed or Monty may have additional recollections.k

[1] https://review.opendev.org/#/c/167793/

-- 
Chris Dent                       Ù©â??̯â??Û¶           https://anticdent.org/
freenode: cdent