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

Obtuse error messages #456

Open
scarroll32 opened this issue Aug 20, 2017 · 1 comment
Open

Obtuse error messages #456

scarroll32 opened this issue Aug 20, 2017 · 1 comment

Comments

@scarroll32
Copy link

Cells is a great gem, and in my opinion should be part of core Rails. Kudos to Nick.

Sometimes though, it can be really hard to track down bugs. The error messages often are a long stacktrace. Othertimes, there are error messages with negative line numbers!

Is this a side effect of the way Cells hooks into Rails ... or could better error messages be somehow produced?

See the stacktrace below .. the actual error is triggered from a cell ruby class ... but where to start looking?

 Rendered deck_card_views/new.html.erb within layouts/application (3.4ms)
Completed 500 Internal Server Error in 83ms (ActiveRecord: 64.5ms)



ActionView::Template::Error - undefined method `constantize' for nil:NilClass:
  actionview (5.1.1) lib/action_view/template/error.rb:67:in `initialize'
  actionview (5.1.1) lib/action_view/template.rb:321:in `handle_render_error'
  actionview (5.1.1) lib/action_view/template.rb:160:in `rescue in render'
  actionview (5.1.1) lib/action_view/template.rb:155:in `render'
  rack-mini-profiler (0.10.5) lib/mini_profiler/profiling_methods.rb:102:in `block in profile_method'
  actionview (5.1.1) lib/action_view/renderer/template_renderer.rb:52:in `block (2 levels) in render_template'
  actionview (5.1.1) lib/action_view/renderer/abstract_renderer.rb:42:in `block in instrument'
  activesupport (5.1.1) lib/active_support/notifications.rb:166:in `block in instrument'
  activesupport (5.1.1) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
  activesupport (5.1.1) lib/active_support/notifications.rb:166:in `instrument'
  actionview (5.1.1) lib/action_view/renderer/abstract_renderer.rb:41:in `instrument'
  actionview (5.1.1) lib/action_view/renderer/template_renderer.rb:51:in `block in render_template'
  actionview (5.1.1) lib/action_view/renderer/template_renderer.rb:59:in `render_with_layout'
  actionview (5.1.1) lib/action_view/renderer/template_renderer.rb:50:in `render_template'
  actionview (5.1.1) lib/action_view/renderer/template_renderer.rb:14:in `render'
  actionview (5.1.1) lib/action_view/renderer/renderer.rb:42:in `render_template'
  actionview (5.1.1) lib/action_view/renderer/renderer.rb:23:in `render'
  actionview (5.1.1) lib/action_view/rendering.rb:103:in `_render_template'
  actionpack (5.1.1) lib/action_controller/metal/streaming.rb:217:in `_render_template'
  actionview (5.1.1) lib/action_view/rendering.rb:83:in `render_to_body'
  actionpack (5.1.1) lib/action_controller/metal/rendering.rb:52:in `render_to_body'
  actionpack (5.1.1) lib/action_controller/metal/renderers.rb:141:in `render_to_body'
  actionpack (5.1.1) lib/abstract_controller/rendering.rb:24:in `render'
  actionpack (5.1.1) lib/action_controller/metal/rendering.rb:36:in `render'
  actionpack (5.1.1) lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
  activesupport (5.1.1) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
  /Users/sean/.rbenv/versions/2.3.3/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
  activesupport (5.1.1) lib/active_support/core_ext/benchmark.rb:12:in `ms'
  actionpack (5.1.1) lib/action_controller/metal/instrumentation.rb:44:in `block in render'
  actionpack (5.1.1) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
  searchkick (2.3.0) lib/searchkick/logging.rb:214:in `cleanup_view_runtime'
  activerecord (5.1.1) lib/active_record/railties/controller_runtime.rb:29:in `cleanup_view_runtime'
  actionpack (5.1.1) lib/action_controller/metal/instrumentation.rb:43:in `render'
  trailblazer-rails (1.0.2) lib/trailblazer/rails/cell.rb:6:in `render'
  app/controllers/resources/deck_card_views_controller.rb:18:in `new'
  actionpack (5.1.1) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
  actionpack (5.1.1) lib/abstract_controller/base.rb:186:in `process_action'
  actionpack (5.1.1) lib/action_controller/metal/rendering.rb:30:in `process_action'
  actionpack (5.1.1) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
  activesupport (5.1.1) lib/active_support/callbacks.rb:108:in `block in run_callbacks'
  react-rails (2.2.0) lib/react/rails/controller_lifecycle.rb:31:in `use_react_component_helper'
  activesupport (5.1.1) lib/active_support/callbacks.rb:117:in `block in run_callbacks'
  activesupport (5.1.1) lib/active_support/callbacks.rb:135:in `run_callbacks'
  actionpack (5.1.1) lib/abstract_controller/callbacks.rb:19:in `process_action'
  actionpack (5.1.1) lib/action_controller/metal/rescue.rb:20:in `process_action'
  actionpack (5.1.1) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
  activesupport (5.1.1) lib/active_support/notifications.rb:166:in `block in instrument'
  activesupport (5.1.1) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
  activesupport (5.1.1) lib/active_support/notifications.rb:166:in `instrument'
  actionpack (5.1.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (5.1.1) lib/action_controller/metal/params_wrapper.rb:252:in `process_action'
  searchkick (2.3.0) lib/searchkick/logging.rb:209:in `process_action'
  activerecord (5.1.1) lib/active_record/railties/controller_runtime.rb:22:in `process_action'
  actionpack (5.1.1) lib/abstract_controller/base.rb:124:in `process'
  actionview (5.1.1) lib/action_view/rendering.rb:30:in `process'
  rack-mini-profiler (0.10.5) lib/mini_profiler/profiling_methods.rb:102:in `block in profile_method'
  actionpack (5.1.1) lib/action_controller/metal.rb:189:in `dispatch'
  actionpack (5.1.1) lib/action_controller/metal.rb:253:in `dispatch'
  actionpack (5.1.1) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
  actionpack (5.1.1) lib/action_dispatch/routing/route_set.rb:31:in `serve'
  actionpack (5.1.1) lib/action_dispatch/journey/router.rb:46:in `block in serve'
  actionpack (5.1.1) lib/action_dispatch/journey/router.rb:33:in `serve'
  actionpack (5.1.1) lib/action_dispatch/routing/route_set.rb:832:in `call'
  omniauth (1.6.1) lib/omniauth/strategy.rb:189:in `call!'
  omniauth (1.6.1) lib/omniauth/strategy.rb:167:in `call'
  omniauth (1.6.1) lib/omniauth/strategy.rb:189:in `call!'
  omniauth (1.6.1) lib/omniauth/strategy.rb:167:in `call'
  omniauth (1.6.1) lib/omniauth/strategy.rb:189:in `call!'
  omniauth (1.6.1) lib/omniauth/strategy.rb:167:in `call'
  omniauth (1.6.1) lib/omniauth/strategy.rb:189:in `call!'
  omniauth (1.6.1) lib/omniauth/strategy.rb:167:in `call'
  omniauth (1.6.1) lib/omniauth/builder.rb:63:in `call'
  warden (1.2.7) lib/warden/manager.rb:36:in `block in call'
  warden (1.2.7) lib/warden/manager.rb:35:in `call'
  rack (2.0.3) lib/rack/etag.rb:25:in `call'
  rack (2.0.3) lib/rack/conditional_get.rb:25:in `call'
  rack (2.0.3) lib/rack/head.rb:12:in `call'
  rack (2.0.3) lib/rack/session/abstract/id.rb:232:in `context'
  rack (2.0.3) lib/rack/session/abstract/id.rb:226:in `call'
  actionpack (5.1.1) lib/action_dispatch/middleware/cookies.rb:613:in `call'
  activerecord (5.1.1) lib/active_record/migration.rb:556:in `call'
  actionpack (5.1.1) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
  activesupport (5.1.1) lib/active_support/callbacks.rb:97:in `run_callbacks'
  actionpack (5.1.1) lib/action_dispatch/middleware/callbacks.rb:24:in `call'
  actionpack (5.1.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
  rollbar (2.14.1) lib/rollbar/middleware/rails/rollbar.rb:24:in `block in call'
  rollbar (2.14.1) lib/rollbar.rb:145:in `scoped'
  rollbar (2.14.1) lib/rollbar/middleware/rails/rollbar.rb:22:in `call'
  better_errors (2.1.1) lib/better_errors/middleware.rb:84:in `protected_app_call'
  better_errors (2.1.1) lib/better_errors/middleware.rb:79:in `better_errors_call'
  better_errors (2.1.1) lib/better_errors/middleware.rb:57:in `call'
  actionpack (5.1.1) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
  rollbar (2.14.1) lib/rollbar/middleware/rails/show_exceptions.rb:22:in `call_with_rollbar'
  actionpack (5.1.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
  railties (5.1.1) lib/rails/rack/logger.rb:36:in `call_app'
  railties (5.1.1) lib/rails/rack/logger.rb:24:in `block in call'
  activesupport (5.1.1) lib/active_support/tagged_logging.rb:69:in `block in tagged'
  activesupport (5.1.1) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (5.1.1) lib/active_support/tagged_logging.rb:69:in `tagged'
  railties (5.1.1) lib/rails/rack/logger.rb:24:in `call'
  sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in `call'
  actionpack (5.1.1) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
  request_store (1.3.2) lib/request_store/middleware.rb:9:in `call'
  actionpack (5.1.1) lib/action_dispatch/middleware/request_id.rb:25:in `call'
  rack (2.0.3) lib/rack/method_override.rb:22:in `call'
  rack (2.0.3) lib/rack/runtime.rb:22:in `call'
  activesupport (5.1.1) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
  actionpack (5.1.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
  actionpack (5.1.1) lib/action_dispatch/middleware/static.rb:125:in `call'
  rack (2.0.3) lib/rack/sendfile.rb:111:in `call'
  rack-mini-profiler (0.10.5) lib/mini_profiler/profiler.rb:282:in `call'
  railties (5.1.1) lib/rails/engine.rb:522:in `call'
  puma (3.9.1) lib/puma/configuration.rb:224:in `call'
  puma (3.9.1) lib/puma/server.rb:602:in `handle_request'
  puma (3.9.1) lib/puma/server.rb:435:in `process_client'
  puma (3.9.1) lib/puma/server.rb:299:in `block in run'
  puma (3.9.1) lib/puma/thread_pool.rb:120:in `block in spawn_thread'
@emptyflask
Copy link

This might also have something to do with better_errors. I noticed that when I removed that gem, I was able to see the offending line inside my cell template.

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

No branches or pull requests

2 participants