# HG changeset patch # User ymh # Date 1323394040 -3600 # Node ID 984ba20c150b0bdb63c51eb825580c6d06dfea40 # Parent ea562f37d7a5a9fa439ec7e69604ae12f43fbcc6 Remove unnecessary try/catch diff -r ea562f37d7a5 -r 984ba20c150b Controller/WikiTagController.php --- a/Controller/WikiTagController.php Fri Dec 09 02:21:17 2011 +0100 +++ b/Controller/WikiTagController.php Fri Dec 09 02:27:20 2011 +0100 @@ -598,12 +598,7 @@ if($label!=$tag->getLabel()){ // We get the Wikipedia informations for the sent label $tag_label_normalized = WikiTagUtils::normalizeTag($label); - try { - $wp_response = WikiTagUtils::getWikipediaInfo($tag_label_normalized); - } - catch (\Exception $e){ - throw new \Exception($e->getMessage()); - } + $wp_response = WikiTagUtils::getWikipediaInfo($tag_label_normalized); $tag->setWikipediaInfo($wp_response); // Save datas. $em = $this->getDoctrine()->getEntityManager(); diff -r ea562f37d7a5 -r 984ba20c150b Entity/TagRepository.php --- a/Entity/TagRepository.php Fri Dec 09 02:21:17 2011 +0100 +++ b/Entity/TagRepository.php Fri Dec 09 02:27:20 2011 +0100 @@ -83,12 +83,7 @@ if($created==true || $tag->getUrlStatus()===Tag::$TAG_URL_STATUS_DICT['null_result']) { if($wp_request_done==false) { - try { - $wp_response = WikiTagUtils::getWikipediaInfo($tag_label_normalized); - } - catch (\Exception $e){ - throw new \Exception($e->getMessage()); - } + $wp_response = WikiTagUtils::getWikipediaInfo($tag_label_normalized); } $tag->setWikipediaInfo($wp_response); @@ -101,13 +96,8 @@ $wikipedia_revision_id = $wp_response['revision_id']; } - else if($tag!=null && $tag->getWikipediaPageId()!=null) { - try { - $wp_response = WikiTagUtils::getWikipediaInfo(null, $tag->getWikipediaPageId()); - } - catch (\Exception $e){ - throw new \Exception($e->getMessage()); - } + elseif($tag!=null && $tag->getWikipediaPageId()!=null) { + $wp_response = WikiTagUtils::getWikipediaInfo(null, $tag->getWikipediaPageId()); $wikipedia_revision_id = $wp_response['revision_id']; } else { diff -r ea562f37d7a5 -r 984ba20c150b Utils/WikiTagUtils.php --- a/Utils/WikiTagUtils.php Fri Dec 09 02:21:17 2011 +0100 +++ b/Utils/WikiTagUtils.php Fri Dec 09 02:27:20 2011 +0100 @@ -60,12 +60,8 @@ return WikiTagUtils::returnNullResult(null); } - try { - $ar = WikiTagUtils::requestWikipedia($params); - } - catch (\Exception $e){ - throw new \Exception($e->getMessage()); - } + $ar = WikiTagUtils::requestWikipedia($params); + $res = $ar[0]; $original_response = $res; $pages = $ar[1];