[katello-devel] Remiving Exception hiding from UI controllers
Petr Chalupa
pchalupa at redhat.com
Fri Jun 28 15:54:49 UTC 2013
I'm about to merge https://github.com/Katello/katello/pull/2427. I need
some ACKs form somebody more familiar with UI. It modifies the behavior
of how exceptions are handled. Exceptions are no longer hidden in
development and test environment, which makes spotting problems and
debugging much more easier.
Anonymous exceptions should not be used in controller actions, e.g.
raise 'missing param ...' unless params[:'...']
they would generate 500 status. There is `render_bad_parameters` instead
for this case:
unless params[:'...']
return render_bad_parameters 'missing param ...'
end
will generate 400 and will show proper warning to user. see usage [1]
This PR is also fixing about 30 false positive tests and adding gem
justified to show exception causes.
[1]
https://github.com/pitr-ch/katello/blob/5ccbe80fff616cbb0d5af887d361e8f2e636be91/app/controllers/application_controller.rb#L360-L372
More information about the katello-devel
mailing list