Exception in Rails

  • Thread starter Mehr, Assaph (Assaph)
  • Start date
M

Mehr, Assaph (Assaph)

I used to get a lot of FloatDomainError exceptions with rails.
Seems like the problem is with
vendor/actionpack/lib/action_controller/benchmarking.rb.

Changing line 46 from:
" | DB: #{sprintf("%f", db_runtime)} (#{sprintf("%d",
db_percentage)}%)"

To:
begin
" | DB: #{sprintf("%f", db_runtime)} (#{sprintf("%d",
db_percentage)}%)"
rescue
" | DB: #{db_runtime} (#{db_percentage}%)"
end

Seems to work.


Cheers,
Assaph


ps. Using Rails 0.5.7 with SQLite on WinXP.
Full exception details:

FloatDomainError in People#list


NaN

vendor/actionpack/lib/action_controller/benchmarking.rb:47:in `sprintf'
vendor/actionpack/lib/action_controller/benchmarking.rb:47:in
`active_record_runtime'
vendor/actionpack/lib/action_controller/benchmarking.rb:33:in
`perform_action_without_filters'
vendor/actionpack/lib/action_controller/filters.rb:221:in
`perform_action_without_rescue'
vendor/actionpack/lib/action_controller/rescue.rb:63:in
`perform_action'
vendor/actionpack/lib/action_controller/base.rb:251:in `process'
vendor/actionpack/lib/action_controller/base.rb:232:in `process'
vendor/railties/dispatcher.rb:46:in `dispatch'
vendor/railties/dispatcher.rb:41:in `rescue_errors'
vendor/railties/dispatcher.rb:47:in `dispatch'
/dispatch.rb:5
/dispatch.rb:1:in `load'
/dispatch.rb:1
-:9
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,237
Latest member
AvivMNS

Latest Threads

Top