In my Rails application, I have a script that updates some records in the database. When I send SIGTERM to kill a script, it sometimes receives this signal while ActiveRecord executes the request. This raises an ActiveRecord :: StatementInvalid exception.
I would like to catch the StatementInvalid exceptions that occur when they are the result of SIGTERM and exit the script. How can I say that StatementInvalid is due to a signal, and not for some other reason?
source
share