Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 1.9.2 Encoding Exception Fix #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ericbeland
Copy link

Hi QuBiT,

I ran into a problem in the exception_logger where an Encoding::CompatibilityError in LoggedExceptions/show would be raised when I tried to view the stack trace web page for a logged exception. The exception complains about Incompatible character encodings: ASCII-8BIT and UTF-8 and seems to be a 1.9.x issue. I pasted the exception below. Feel free to take this patch, or modify it to something more appropriate.

The exception:

Request

"incompatible character encodings: ASCII-8BIT and UTF-8"
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/core_ext/string/output_safety.rb:80:in concat' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/core_ext/string/output_safety.rb:80:inconcat'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_view/template/handlers/erb.rb:14:in <<' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/exception_logger-0.1.10/app/views/logged_exceptions/_show.html.erb:23:in__home_ebeland__rvm_gems_ruby_______p____rails__gems_exception_logger________app_views_logged_exceptions__show_html_erb__1048433563257994963_69256160_346504932021220071'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_view/template.rb:135:in block in render' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/notifications.rb:54:ininstrument'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_view/template.rb:127:in render' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_view/render/partials.rb:333:inrender_partial'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_view/render/partials.rb:262:in block in render' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/notifications.rb:52:inblock in instrument'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/notifications/instrumenter.rb:21:in instrument' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/notifications.rb:52:ininstrument'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_view/render/partials.rb:260:in render' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_view/render/partials.rb:378:in_render_partial'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_view/render/rendering.rb:22:in render' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/exception_logger-0.1.10/app/views/logged_exceptions/show.js.erb:1:in__home_ebeland__rvm_gems_ruby_______p____rails__gems_exception_logger________app_views_logged_exceptions_show_js_erb__912490557471836570_69408440_250743224321483200'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_view/template.rb:135:in block in render' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/notifications.rb:54:ininstrument'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_view/template.rb:127:in render' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_view/render/rendering.rb:59:inblock in _render_template'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/notifications.rb:52:in block in instrument' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/notifications/instrumenter.rb:21:ininstrument'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/notifications.rb:52:in instrument' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_view/render/rendering.rb:56:in_render_template'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_view/render/rendering.rb:26:in render' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/abstract_controller/rendering.rb:115:in_render_template'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/abstract_controller/rendering.rb:109:in render_to_body' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal/renderers.rb:47:inrender_to_body'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal/compatibility.rb:55:in render_to_body' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/abstract_controller/rendering.rb:102:inrender_to_string'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/abstract_controller/rendering.rb:93:in render' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal/rendering.rb:17:inrender'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal/instrumentation.rb:40:in block (2 levels) in render' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/core_ext/benchmark.rb:5:inblock in ms'
/home/ebeland/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/benchmark.rb:309:in realtime' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/core_ext/benchmark.rb:5:inms'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal/instrumentation.rb:40:in block in render' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal/instrumentation.rb:78:incleanup_view_runtime'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activerecord-3.0.7/lib/active_record/railties/controller_runtime.rb:15:in cleanup_view_runtime' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal/instrumentation.rb:39:inrender'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal/implicit_render.rb:14:in default_render' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal/mime_responds.rb:261:inblock in retrieve_response_from_mimes'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal/mime_responds.rb:192:in call' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal/mime_responds.rb:192:inrespond_to'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/exception_logger-0.1.10/app/controllers/logged_exceptions_controller.rb:55:in show' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal/implicit_render.rb:5:insend_action'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/abstract_controller/base.rb:150:in process_action' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal/rendering.rb:11:inprocess_action'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/abstract_controller/callbacks.rb:18:in block in process_action' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:471:in_run__3879638759732891400__process_action__2025434870542418597__callbacks'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:410:in _run_process_action_callbacks' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:94:inrun_callbacks'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/abstract_controller/callbacks.rb:17:in process_action' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal/instrumentation.rb:30:inblock in process_action'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/notifications.rb:52:in block in instrument' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/notifications/instrumenter.rb:21:ininstrument'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/notifications.rb:52:in instrument' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal/instrumentation.rb:29:inprocess_action'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal/rescue.rb:17:in process_action' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/abstract_controller/base.rb:119:inprocess'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/abstract_controller/rendering.rb:41:in process' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal.rb:138:indispatch'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal/rack_delegation.rb:14:in dispatch' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_controller/metal.rb:178:inblock in action'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_dispatch/routing/route_set.rb:62:in call' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_dispatch/routing/route_set.rb:62:indispatch'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_dispatch/routing/route_set.rb:27:in call' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb:148:inblock in call'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:93:in block in recognize' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:103:inoptimized_each'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:92:in recognize' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb:139:incall'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_dispatch/routing/route_set.rb:493:in call' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_dispatch/middleware/static.rb:30:incall'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_dispatch/middleware/static.rb:30:in call' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_dispatch/middleware/best_standards_support.rb:17:incall'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_dispatch/middleware/head.rb:14:in call' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/rack-1.2.2/lib/rack/methodoverride.rb:24:incall'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_dispatch/middleware/params_parser.rb:21:in call' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_dispatch/middleware/flash.rb:182:incall'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_dispatch/middleware/session/abstract_store.rb:149:in call' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_dispatch/middleware/cookies.rb:302:incall'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activerecord-3.0.7/lib/active_record/query_cache.rb:32:in block in call' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/query_cache.rb:28:incache'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activerecord-3.0.7/lib/active_record/query_cache.rb:12:in cache' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activerecord-3.0.7/lib/active_record/query_cache.rb:31:incall'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in call' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_dispatch/middleware/callbacks.rb:46:inblock in call'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:416:in _run_call_callbacks' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_dispatch/middleware/callbacks.rb:44:incall'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/rack-1.2.2/lib/rack/sendfile.rb:107:in call' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_dispatch/middleware/remote_ip.rb:48:incall'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_dispatch/middleware/show_exceptions.rb:47:in call' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/railties-3.0.7/lib/rails/rack/logger.rb:13:incall'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/rack-1.2.2/lib/rack/runtime.rb:17:in call' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/activesupport-3.0.7/lib/active_support/cache/strategy/local_cache.rb:72:incall'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/rack-1.2.2/lib/rack/lock.rb:11:in block in call' :10:insynchronize'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/rack-1.2.2/lib/rack/lock.rb:11:in call' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/actionpack-3.0.7/lib/action_dispatch/middleware/static.rb:30:incall'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/railties-3.0.7/lib/rails/application.rb:168:in call' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/railties-3.0.7/lib/rails/application.rb:77:inmethod_missing'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/railties-3.0.7/lib/rails/rack/log_tailer.rb:14:in call' /home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/rack-1.2.2/lib/rack/content_length.rb:13:incall'
/home/ebeland/.rvm/gems/ruby-1.9.2-p180@rails3/gems/rack-1.2.2/lib/rack/handler/webrick.rb:52:in service' /home/ebeland/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:111:inservice'
/home/ebeland/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:70:in run' /home/ebeland/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/server.rb:183:inblock in start_thread'

… in LoggedExceptions/show. Incompatible character encodings: ASCII-8BIT and UTF-8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants