Handle encoding error and skip sending the message