Skip to content

Commit

Permalink
Correct exception handling to account for namespace and proper Except…
Browse files Browse the repository at this point in the history
…ion class
  • Loading branch information
mattwright committed Dec 4, 2011
1 parent e9d083e commit fdf34b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Embedly/Embedly.php
Expand Up @@ -100,7 +100,7 @@ protected function parse_host($host)
preg_match('/^(https?:\/\/)?([^\/]+)(:\d+)?\/?$/', $host, $matches);

if (!$matches) {
throw new Error(sprintf('invalid host %s', host));
throw new \Exception(sprintf('invalid host %s', host));
}

$hostname = $matches[2];
Expand Down Expand Up @@ -311,7 +311,7 @@ protected function curlExec(&$ch)
{
$res = curl_exec($ch);
if (false === $res) {
throw new Exception(curl_error($ch), curl_errno($ch));
throw new \Exception(curl_error($ch), curl_errno($ch));
}
return $res;
}
Expand Down

0 comments on commit fdf34b2

Please sign in to comment.