Bug #25677
openUpdating proxy location returns misleading error messages
Description
Description of problem:
The API call to replace the location_ids of the smart_proxy returns a misleading error message.
When trying to pass the location ids which does not exists, it returns the following error message:
"error": { "message": "Resource smart_proxy not found by id '1'" }
It should provide error message as:
"error": {"message": "Resource location not found by id '3'" }
Second issue is that when I pass organization id as a location id, I get a message that does not really explain what the problem is:
"error": { "message": "Validation failed: Taxonomy has already been taken" }
How reproducible:
Always
Steps to Reproduce:
1. Hit the Curl API to replace the location_ids of the smart_proxy, make sure there is no location with id == 4
~~
curl -X PUT -s -k -u "admin:changeme" -d '{"smart_proxy": {"location_ids": [4]}}' -H "Accept:application/json,version=2" -H "Content-Type:application/json" https://$(hostname)/api/v2/smart_proxies/1
~~
2. This will return error as
"error": { "message": "Resource smart_proxy not found by id '1'" }
3. Try to update with id of Default Organization (or any other org) as location_id: { "location_ids": [1] }
"error": { "message": "Validation failed: Taxonomy has already been taken" }
Expected results:
Meaningful error messages that do not mislead users.
Updated by Ondřej Pražák over 5 years ago
- Subject changed from Updating proxy location returns misleading error messages to Updating proxy location returns misleading error messages
- Priority changed from High to Normal