Extend on_data method by including a conditional to process warning messages and add the definition of the method to manage those warning messages