throw exception if read fails