Feature #2757
closedShow errors logs in the production.log for the API
Description
When I call any Foreman New API service and it fails during saving in ActiveRecord, only ActiveRecord::RecordNotSaved exception (message) is shown and the reason (errors array) is hidden.
We need to use either save! method when saving or handing the active record object into the base controller for checks.
Updated by Tomáš Strachota over 11 years ago
- Assignee set to Tomáš Strachota
I haven't managed to reproduce it. Can you please provide more details? What api version and resource you tried it with? Did you use foreman-api library or was it via curl?
Updated by Lukas Zapletal over 11 years ago
- Tracker changed from Bug to Feature
- Subject changed from Foreman API hides exceptions to Show errors logs in the production.log for the API
Updated by Marek Hulán over 11 years ago
Not sure whether it helps, but anyway.. I encountered similar error because of validation errors on some associated object a month ago. Save returned false (which is usually not checked) and errors on main object was empty. Could this be the cause? Particular problem I described is already fixed btw.
Updated by Lukas Zapletal over 11 years ago
- Target version changed from 1.3.0 to 1.2.1
Marek, this must be something else. In my case, I do see errors array but there is no way of digging in the problem.
Since users are reporting issues with this on the channel, I am setting target version to 1.2.1. Tomas can you please provide fix for 1.2 stable? Users are starting with the API and hitting errors, this could help them to track validation problems.
Updated by Sam Kottler over 11 years ago
- Status changed from New to Assigned
Any update on this? Tomas, I'm happy to work on this if you're not already.
Updated by Tomáš Strachota over 11 years ago
I wanted to start today but got stuck with other tasks. Feel free to take it if you want. Otherwise I'll do it tomorrow (Friday) morning.
Updated by Tomáš Strachota over 11 years ago
- Status changed from Assigned to Ready For Testing
Updated by Dominic Cleal over 11 years ago
- Target version changed from 1.2.1 to 1.3.0
Updated by Anonymous over 11 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 988a1f4d8ff80f8e3ccde3cf287dd6a5293a3964.