Falcon error handlers not being consistently used, logging
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Backup/Restore and DR (Freezer) |
In Progress
|
Undecided
|
Domhnall Walsh |
Bug Description
The error handler mechanism as used in falcon provides a facility to log messages when bad requests occur - typically, these would mostly correspond to HTTP status codes in the 4xx range.
However, it appears that in a lot of cases the HTTP status code is being set explicitly in a manually generated, per-endpoint response rather than raising the appropriate exception, so the logging is not happening and the API is inconsistent in the way it communicates with its consumer(s).
The API should raise the appropriate exceptions for each of the error conditions for which one is defined (4xx, 500) instead of explicitly setting the HTTP status code, so that logging is consistently achieved and that every error message of a given type looks at least somewhat consistent.
Changed in freezer: | |
assignee: | nobody → Domhnall Walsh (domhnall-walsh) |
Mostly, this revolves around HTTP 404 (not found) errors, but I do note with some surprise a HTTP 753 (which I can't find anywhere online except the falcon docs) which apparently gets reported when you PUT/POST malformed JSON.
This error code seems wrong to me but I don't want to propose making changes there because it would change the behaviour of the API (even if it is under the conditions of user error) and therefore might require an API versioning bump.