Convert WriteMessage errors to MessgeError type.