Add the error handler to the insert_record method.