On Wednesday, June 21, 2006, at 10:20 AM, Philip Hallstrom
wrote:>> 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
>_______________________________________________
>Rails mailing list
>Rails@lists.rubyonrails.org
>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:in `update''
/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:in `perform_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:in `perform_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:in `perform_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:in `send''
/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:in `process''
/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:in
`process_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:in
`each_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:in
`each_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:in
`process!''
/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
--
Posted with http://DevLists.com. Sign up and save your mailbox.