Incorporate ActiveRecord::Base.exists? into error handling