read err message before close