Skip to content
Browse files

catch the HTTP_Request2_Exception in the fetch() function

  • Loading branch information...
1 parent d049617 commit afc1cdd944ecba5c01917c48dc8a5525146ea1b3 @hm2k hm2k committed Feb 1, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 Services/Mailman.php
View
10 Services/Mailman.php
@@ -197,9 +197,13 @@ protected function fetch($url)
if (!$url) {
throw new Services_Mailman_Exception('Invalid URL');
}
- $this->request->setUrl($url);
- $this->request->setMethod('GET');
- $html = $this->request->send()->getBody();
+ try {
+ $this->request->setUrl($url);
+ $this->request->setMethod('GET');
+ $html = $this->request->send()->getBody();
+ } catch (HTTP_Request2_Exception $e) {
+ throw new Services_Mailman_Exception($e);
+ }
if (strlen($html)>5) {
return $html;
}

0 comments on commit afc1cdd

Please sign in to comment.
Something went wrong with that request. Please try again.