From 6f284a227f697889753b514c77f5cfc447f9bba8 Mon Sep 17 00:00:00 2001
From: Matthieu Guffroy <mattgu74@gmail.com>
Date: Thu, 19 Jun 2014 01:40:23 +0200
Subject: [PATCH] check excpetion

---
 view/list.php | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/view/list.php b/view/list.php
index b54bfc5..198050e 100644
--- a/view/list.php
+++ b/view/list.php
@@ -3,7 +3,15 @@
     <div class="page-header">
         <h1><?php echo $list->getTitle(); ?></h1>
     </div>
-    <?php try { ?>
+    <?php 
+    $ok = true;
+    try { 
+        $list->getLabels();
+    } catch (Exception $e) { 
+        echo $e->getMessage();
+        $ok = false;
+    } ?>
+    <?php if($ok) { ?>
     <table class="table">
         <thead>
             <?php foreach($list->getLabels() as $field): ?>
@@ -22,7 +30,5 @@
             <?php endforeach; ?>
         </tbody>
     </table>
-    <?php } catch (Exception $e) { 
-        //echo $e->getMessage();
-    } ?>
+    <?php } ?>
 </div>
\ No newline at end of file
-- 
GitLab