+ /**
+ * Checks the HTTP response code and throws an exception if it
+ * is not in the 200 range.
+ *
+ * @param HTTP_Request2_Response $resp HTTP response object
+ *
+ * @return void
+ *
+ * @throws Exception When the status is not 200-299
+ */
+ protected function checkResponseStatus(HTTP_Request2_Response $resp)
+ {
+ $nStatus = $resp->getStatus();
+ $this->log($nStatus . ' ' . $resp->getReasonPhrase(), 1);
+ if (intval($nStatus / 100) == 2) {
+ //2xx status is fine
+ return;
+ }
+
+ throw new Exception(
+ 'HTTP Error: ' . $nStatus . ' ' . $resp->getReasonPhrase()
+ );
+ }
+
+
+