throw invalid reponse code