Entity/TagRepository.php
changeset 50 e967654e90cb
parent 42 0e57c730bb18
child 59 ea562f37d7a5
--- a/Entity/TagRepository.php	Mon Nov 28 15:58:34 2011 +0100
+++ b/Entity/TagRepository.php	Wed Nov 30 17:58:18 2011 +0100
@@ -86,7 +86,12 @@
                 }
             }
             if($match_exists==false) {
-                $wp_response = WikiTagUtils::getWikipediaInfo($tag_label_normalized);
+                try {
+                    $wp_response = WikiTagUtils::getWikipediaInfo($tag_label_normalized);
+                }
+                catch (\Exception $e){
+                    throw new \Exception($e->getMessage());
+                }
                 $status = $wp_response['status'];
                 if($status==Tag::$TAG_URL_STATUS_DICT['match']) {
                     $tag = new Tag();
@@ -103,7 +108,12 @@
         if($created==true) {
             
             if($wp_request_done==false) {
-                $wp_response = WikiTagUtils::getWikipediaInfo($tag_label_normalized);
+                try {
+                    $wp_response = WikiTagUtils::getWikipediaInfo($tag_label_normalized);
+                }
+                catch (\Exception $e){
+                    throw new \Exception($e->getMessage());
+                }
             }
             
             $tag->setWikipediaInfo($wp_response);
@@ -117,8 +127,12 @@
     
         }
         else if($tag!=null && $tag->getWikipediaPageId()!=null) {
-            
-            $wp_response = WikiTagUtils::getWikipediaInfo(null, $tag->getWikipediaPageId());
+            try {
+                $wp_response = WikiTagUtils::getWikipediaInfo(null, $tag->getWikipediaPageId());
+            }
+            catch (\Exception $e){
+                throw new \Exception($e->getMessage());
+            }
             $wikipedia_revision_id = $wp_response['revision_id'];
         }
         else {