added check for HttpResponseError in the DoRawHttpRequest method