Files
watcher/releasenotes/notes/return-error-400-on-bad-parameters-bb964e4f5cadc15c.yaml
Alfredo Moralejo e5b5ff5d56 Return HTTP code 400 when creating an audit with wrong parameters
Currently, when trying to create an audit which misses a mandatory
parameter watcher returns error 500 instead of 400 which is the
documented error in the API [1] and the appropiate error code for
malformed requests.

This patch catch parameters validation errors according to the json
schema for each strategy and returns error 400. It also fixes the
unit test to validate the expected behavior.

[1] https://docs.openstack.org/api-ref/resource-optimization/#audits

Closes-Bug: #2110538
Change-Id: I23232b3b54421839bb01d54386d4e7b244f4e2a0
(cherry picked from commit 4629402f38)
Signed-off-by: Alfredo Moralejo <amoralej@redhat.com>
2025-07-02 08:07:26 +02:00

8 lines
259 B
YAML

---
fixes:
- |
`Bug #2110538 <https://bugs.launchpad.net/watcher/+bug/2110538>`_:
Corrected the HTTP error code returned when watcher users try to create
audits with invalid parameters. The API now correctly returns a 400 Bad
Request error.