Handle mqtt exception properly