smartinez87/exception_notification — Issue #42: exception when trying to print env
Author: phoet
Created: 2011-12-02 13:48:47+00:00
State: open

exception_notification raises an error when it tries to cope with exceptions thrown by couchrest_model:

```
.../exception_notification-2.5.2/lib/exception_notifier/views/exception_notifier/_request.text.erb (0.1ms)
.../exception_notification-2.5.2/lib/exception_notifier/views/exception_notifier/_title.text.erb (0.0ms)
.../exception_notification-2.5.2/lib/exception_notifier/views/exception_notifier/_session.text.erb (0.5ms)
.../exception_notification-2.5.2/lib/exception_notifier/views/exception_notifier/_title.text.erb (0.0ms)
.../exception_notification-2.5.2/lib/exception_notifier/views/exception_notifier/_environment.text.erb (4.5ms)
.../exception_notification-2.5.2/lib/exception_notifier/views/exception_notifier/exception_notification.text.erb (6.0ms)
ActionView::Template::Error (comparison of Symbol with String failed):
1: <% filtered_env = @request.filtered_env -%>
2: <% max = filtered_env.keys.max { |a, b| a.length <=> b.length } -%>
3: <% filtered_env.keys.sort.each do |key| -%>
4: * <%= raw("%-*s: %s" % [max.length, key, inspect_object(filtered_env[key])]) %>
5: <% end -%>
6:
lib/mobile/detection.rb:8:in `call'
lib/protocol/writer.rb:17:in `call'
lib/support/char_converter.rb:15:in `call'
Completed 500 Internal Server Error in 248.5ms (Views: 210.179ms | CouchDB: 16.243ms(3q))
```

this is due to the fact that the filtered_env is supposed to return only one type (String/Symbol) but returns a mix.