Project

General

Profile

Actions

Bug #16813

closed

Confusing error message on association not found error

Added by Marek Hulán about 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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.


Related issues 2 (0 open2 closed)

Related to Foreman - Bug #13704: Error when updating host location by name through APIClosedShlomi Zadok02/15/2016Actions
Related to Foreman - Bug #16846: Org create returns unclear message when trying to assign a non-existent subnetClosedAmit Karsale10/10/2016Actions
Actions #1

Updated by Marek Hulán about 8 years ago

  • Subject changed from Confusing error message on association not found error to Confusing error message on association not found error
  • Status changed from New to Assigned
  • Assignee set to Marek Hulán
  • Target version set to 1.5.0

not sure about proper category, please feel free to change

Actions #2

Updated by Marek Hulán about 8 years ago

  • Related to Bug #13704: Error when updating host location by name through API added
Actions #3

Updated by The Foreman Bot about 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3923 added
Actions #4

Updated by Dominic Cleal about 8 years ago

  • Category changed from Unattended installations to API
  • Translation missing: en.field_release set to 190
Actions #5

Updated by Marek Hulán about 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #6

Updated by Dominic Cleal about 8 years ago

  • Has duplicate Bug #16846: Org create returns unclear message when trying to assign a non-existent subnet added
Actions #7

Updated by Dominic Cleal about 8 years ago

  • Has duplicate deleted (Bug #16846: Org create returns unclear message when trying to assign a non-existent subnet)
Actions #8

Updated by Dominic Cleal about 8 years ago

  • Related to Bug #16846: Org create returns unclear message when trying to assign a non-existent subnet added
Actions

Also available in: Atom PDF