Minimal Rails app to demonstrate a bug where Sentry doesn’t record exceptions caused by Rails runner.
Steps to reproduce:
-
Clone the repo and run bundle install
-
Export SENTRY_SECURE_URL environment variable:
export SENTRY_SECURE_URL="https://user:[email protected]/app_id"
-
Use Rails runner to run some code that causes an exception:
./bin/rails runner "1 / 0"
Sentry loads correctly, and is configured in config/initializers/raven.rb to report exceptions in development, but doesn’t record an exception.
Contrast this with the exception and exception_with_rails_environment_loaded rake tasks, where Sentry does correctly record exceptions.