Print error if occurred in WriteMsg