Logging raw SQL errors in Rake Tasks
|Added at||2016-12-22 16:12|
I'm using raw sql bulk updates (for performance reasons) in the context of a rake task. Something like the following:
While everything is "transparent" in local development, if this SQL fails in production during the execution of the rails task (for example because the promotion column is nil and the statement becomes invalid), no error is logged.
I can manually log this with catching the exception, like below, however some option that would allow for automatic logging would be better.