Set up the template to throw an exception if there is a problem writing to the database.