Actions
Bug #16813
closedConfusing error message on association not found error
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1379006
Description of problem:
When association can't be found we don't render proper error message. For example if I use pxelinux instead of PXELinux template kind like this
curl -X POST https://admin:changeme@foreman.example.tst/api/config_templates -H 'Content-Type: application/json' -H 'ForemanApiVersion: 2' -d '{"config_template": { "name":"b", "template":"b","template_kind_name":"pxelinux" }}'
it renders
{
"error": {"message":"Resource config_template not found by id ''"}
}
While I would expect something like "Could not find template_kind with name: pxelinux". We should detect that the RecordNotFound
exception was triggered in has_many_common and adjust the error message accordingly.
Note that the original BZ was partly fixed by #13704 which fixed the backtrace but the error message remain confusing.
Actions