To run a script on heroku detatched, s/t your terminal doesn't have to maintain connection (do this always when running long scripts, then check if the script worked!) You'll still now how to figure out how to handle exceptions... they won't be logged anywhere.
heroku run:detached bundle exec rake my_task:my_action
Then print logs like this:
heroku logs --app rtrvr --dyno run.{{process number}} --tail
Don't believe me? https://stackoverflow.com/questions/14894839/if-i-close-my-terminal-would-a-rake-task-started-on-heroku-continue-to-run/14902204