octavia/releasenotes/notes/improve-error-message-failed-constraints-6ad10bd22cac523a.yaml
Gregory Thiemonge 57e006eac3 Fix unclear error messages in the API
Some API calls may have returned useless error messages such as

{"faultcode": "Client", "faultstring": " is not a valid option for ",
 "debuginfo": null}

when a DB constraint failed.

This commit improves the error message by reading the name of the
foreign key that failed from the exception.

The value of the parameters should have already been validated by WSME,
this exception is only thrown when there is an issue with the database
(corrupted DB, empty table or missing fields in a table).

Story 2009957
Task 44919

Change-Id: Idd6480bc0a7de7c42b34601172c2dae50077aa48
2022-08-17 11:47:13 +02:00

7 lines
228 B
YAML

---
fixes:
- |
The Octavia API returned an unhelpful message when a constraint failed
while creating an object in the DB. The error now contains the name and the
value of the parameter that breaks the constraints.