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

Bug: doesn't work with rails runner #119

Open
swanson opened this issue Feb 15, 2021 · 1 comment
Open

Bug: doesn't work with rails runner #119

swanson opened this issue Feb 15, 2021 · 1 comment

Comments

@swanson
Copy link

swanson commented Feb 15, 2021

I often use rails runner $PATH_TO_SCRIPT to run import scripts or other miscellaneous tasks (similar to rake tasks). But since the runner command is only running the script, the pry-rescue middleware isn't involved and no exceptions get rescued when doing rescue rails runner $PATH_TO_SCRIPT.

@swanson
Copy link
Author

swanson commented Feb 15, 2021

Workaround: passing -i flag will at least catch the exceptions, but not ideal since it pulls up the session regardless of if there was an error or not.

bundle exec rescue -i bin/rails runner db/import.rb

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

1 participant