Show Exceptions in Production mode

Does someone know what to set so that exceptions are shown (to user)
when in production mode? I would like the exception to show exactly as
it does in development mode.

I know that they are written to the log.

Richard
RogueWaveMarine.com

On 21 Jun 2006 15:11:15 -0000, Richard W.
[email protected] wrote:


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

config.action_controller.consider_all_requests_local = true

in production.rb

Does someone know what to set so that exceptions are shown (to user)
when in production mode? I would like the exception to show exactly as
it does in development mode.

I know that they are written to the log.

In config/environments/production.rb…

config.action_controller.consider_all_requests_local = false

I think switching that to true will do what you want.

-philip

On Wednesday, June 21, 2006, at 10:20 AM, Philip H. wrote:

I think switching that to true will do what you want.

-philip


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

OK, I did that and now if a rails error occurs, e.g. a call to a method
that doesn’t exist, the exception is trapped and the traceback is
displayed to the user.

However if my “raise” is hit the exception only goes to the log.

Here is my code in a controller:

match = /[\x80-\xff]/ =~ @item.description
if ! match.nil?
raise "Bad character(s) in description: "
end

Here is the exception from the log:

RuntimeError (Bad character(s) in description: )
/app/controllers/items_controller.rb:439:in process_form_data' /app/controllers/items_controller.rb:563:inupdate’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/
base.rb:841:in send' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/ base.rb:841:inperform_action_without_filters’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/
filters.rb:332:in perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/ benchmarking.rb:69:inperform_action_without_rescue’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/
benchmarking.rb:69:in measure' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/ benchmarking.rb:69:inperform_action_without_rescue’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/
rescue.rb:82:in perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/ base.rb:365:insend’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/
base.rb:365:in process_without_session_management_support' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/ session_management.rb:116:inprocess’
/usr/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/dispatcher.rb:38:in
dispatch' /usr/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/fcgi_handler.rb:141:inprocess_request’
/usr/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/fcgi_handler.rb:53:in
process!' /usr/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/fcgi_handler.rb:52:ineach_cgi’
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:597:in each' /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:597:ineach_cgi’
/usr/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/fcgi_handler.rb:52:in
process!' /usr/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/fcgi_handler.rb:22:inprocess!’
/Library/WebServer/Documents/Store/Inventory/public/dispatch.fcgi:24

Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/
action_controller/templates/rescues/layout.rhtml (500 Internal Error)

Richard
RogueWaveMarine.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs