Index: main/plugin-sms/src/org/ametys/plugins/sms/SubscribersListGenerator.java
===================================================================
--- main/plugin-sms/src/org/ametys/plugins/sms/SubscribersListGenerator.java	(revision 29419)
+++ main/plugin-sms/src/org/ametys/plugins/sms/SubscribersListGenerator.java	(working copy)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2014 Anyware Services
+ *  Copyright 2015 Anyware Services
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -15,27 +15,20 @@
  */
 package org.ametys.plugins.sms;
 
-import java.io.IOException;
 import java.util.HashMap;
 
-import javax.jcr.RepositoryException;
-
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.generation.ServiceableGenerator;
 import org.apache.cocoon.xml.AttributesImpl;
 import org.apache.cocoon.xml.XMLUtils;
-import org.xml.sax.SAXException;
 
-import org.ametys.plugins.repository.AmetysRepositoryException;
 import org.ametys.plugins.sms.dao.JCRSubscribersList;
 import org.ametys.plugins.sms.dao.SubscribeDAO;
 import org.ametys.plugins.sms.dao.SubscriberListsDAO;
 
-
 /**
- * get all SMS list
+ * Generator of SMS lists
  */
 public class SubscribersListGenerator extends ServiceableGenerator
 {
@@ -53,26 +46,27 @@
         _subscribeDAO = (SubscribeDAO) serviceManager.lookup(SubscribeDAO.ROLE);
     }
     
-    public void generate() throws IOException, SAXException, ProcessingException
+    @Override
+    public void generate() 
     {
         String siteName = parameters.getParameter("site-name", "");
         String lang = parameters.getParameter("lang", "");
-                
-        contentHandler.startDocument();
-        XMLUtils.startElement(contentHandler, "lists");
         
-        HashMap<String, Integer> smsListMap = _subscribeDAO.getNbUserFromList();
         try
-        {
-            for (JCRSubscribersList subscriberlist : _subscriberListDAO.getSubscribersLists(siteName, lang))
+        {     
+            contentHandler.startDocument();
+            XMLUtils.startElement(contentHandler, "lists");
+            
+            HashMap<String, Integer> smsListMap = _subscribeDAO.getNbUserFromList();
+            for (JCRSubscribersList subscribersList : _subscriberListDAO.getSubscribersLists(siteName, lang))
             {
-                String subscriberListId = subscriberlist.getId();
+                String subscriberListId = subscribersList.getId();
                 
                 AttributesImpl attr = new AttributesImpl();
                 attr.addCDATAAttribute("id", subscriberListId);
                 
                 XMLUtils.startElement(contentHandler, "list", attr);
-                XMLUtils.createElement(contentHandler, "label", subscriberlist.getTitle());
+                XMLUtils.createElement(contentHandler, "label", subscribersList.getTitle());
                 if (smsListMap.containsKey(subscriberListId))
                 {
                     XMLUtils.createElement(contentHandler, "nb-user", smsListMap.get(subscriberListId).toString());
@@ -83,18 +77,13 @@
                 }
                 XMLUtils.endElement(contentHandler, "list");
             }
+            
+            XMLUtils.endElement(contentHandler, "lists");
+            contentHandler.endDocument();
         }
-        catch (AmetysRepositoryException e)
+        catch (Exception e)
         {
-            e.printStackTrace();
+            getLogger().error("An error occurred while generating the subscribers' lists", e);
         }
-        catch (RepositoryException e)
-        {
-            e.printStackTrace();
-        }
-        
-        XMLUtils.endElement(contentHandler, "lists");
-        contentHandler.endDocument();
     }
-
 }
Index: main/plugin-sms/src/org/ametys/plugins/sms/action/DeleteListAction.java
===================================================================
--- main/plugin-sms/src/org/ametys/plugins/sms/action/DeleteListAction.java	(revision 29419)
+++ main/plugin-sms/src/org/ametys/plugins/sms/action/DeleteListAction.java	(working copy)
@@ -86,7 +86,7 @@
                 list.remove();
                 parent.saveChanges();
     
-                _subscribeDAO.deleteAllNumber(idList);
+                _subscribeDAO.deleteAllNumbers(idList);
             }
         }
         else
Index: main/plugin-sms/src/org/ametys/plugins/sms/dao/SubscribeDAO.java
===================================================================
--- main/plugin-sms/src/org/ametys/plugins/sms/dao/SubscribeDAO.java	(revision 29419)
+++ main/plugin-sms/src/org/ametys/plugins/sms/dao/SubscribeDAO.java	(working copy)
@@ -81,8 +81,9 @@
      * Insert the phoneNumber in the database
      * @param phoneNumber
      * @param list
+     * @throws SQLException if an exception occurs during the transactions with the database
      */
-    public void insertNumber(String phoneNumber, String list)
+    public void insertNumber(String phoneNumber, String list) throws SQLException
     {
         Connection con = null;
         PreparedStatement stmt = null;
@@ -104,10 +105,6 @@
             
             stmt.execute();
         }
-        catch (SQLException e)
-        {
-            getLogger().error("Error during the connection to the database", e);
-        }
         finally
         {
             ConnectionHelper.cleanup(rs);
@@ -120,8 +117,9 @@
      * Delete the phoneNumber in the database
      * @param phoneNumber
      * @param list
+     * @throws SQLException if an exception occurs during the transactions with the database
      */
-    public void deleteNumber(String phoneNumber, String list)
+    public void deleteNumber(String phoneNumber, String list) throws SQLException
     {
         Connection con = null;
         PreparedStatement stmt = null;
@@ -142,10 +140,6 @@
             
             stmt.execute();
         }
-        catch (SQLException e)
-        {
-            getLogger().error("Error during the connection to the database", e);
-        }
         finally
         {
             ConnectionHelper.cleanup(rs);
@@ -158,7 +152,7 @@
      * Delete all phoneNumber from a list
      * @param list
      */
-    public void deleteAllNumber(String list)
+    public void deleteAllNumbers(String list)
     {
         Connection con = null;
         PreparedStatement stmt = null;
@@ -190,8 +184,9 @@
      * Get all the phoneNumber in the database form the list
      * @param list
      * @return the phone number list
+     * @throws SQLException if an exception occurs during the transactions with the database
      */
-    public HashMap<String, String> getPhoneNumbersFromList(String list)
+    public HashMap<String, String> getPhoneNumbersFromList(String list) throws SQLException
     {
         Connection con = null;
         PreparedStatement stmt = null;
@@ -215,11 +210,6 @@
             
             return listPhoneNumbers;
         }
-        catch (SQLException e)
-        {
-            getLogger().error("Error during the connection to the database", e);
-            return null;
-        }
         finally
         {
             ConnectionHelper.cleanup(rs);
@@ -231,8 +221,9 @@
     /**
      * Get the number of user in a list
      * @return the number of user for each sms list
+     * @throws SQLException if an exception occurs during the transactions with the database
      */
-    public HashMap<String, Integer> getNbUserFromList()
+    public HashMap<String, Integer> getNbUserFromList() throws SQLException 
     {
         Connection con = null;
         PreparedStatement stmt = null;
@@ -255,11 +246,6 @@
             
             return smsListMap;
         }
-        catch (SQLException e)
-        {
-            getLogger().error("Error during the connection to the database", e);
-            return new HashMap<String, Integer>();
-        }
         finally
         {
             ConnectionHelper.cleanup(rs);
Index: main/plugin-sms/src/org/ametys/plugins/sms/dao/SubscriberListsDAO.java
===================================================================
--- main/plugin-sms/src/org/ametys/plugins/sms/dao/SubscriberListsDAO.java	(revision 29419)
+++ main/plugin-sms/src/org/ametys/plugins/sms/dao/SubscriberListsDAO.java	(working copy)
@@ -80,7 +80,7 @@
         
         ((ModifiableAmetysObject) parentNode).saveChanges();
         
-        return  subCategory.getId();
+        return subCategory.getId();
     }
     
     /**
Index: main/plugin-sms/src/org/ametys/plugins/sms/service/SubscribeAction.java
===================================================================
--- main/plugin-sms/src/org/ametys/plugins/sms/service/SubscribeAction.java	(revision 29419)
+++ main/plugin-sms/src/org/ametys/plugins/sms/service/SubscribeAction.java	(working copy)
@@ -15,6 +15,7 @@
  */
 package org.ametys.plugins.sms.service;
 
+import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -142,7 +143,7 @@
         return EMPTY_MAP;
     }
 
-    private void _process(Map<String, Object> result, String phoneNumber, String register, String list)
+    private void _process(Map<String, Object> result, String phoneNumber, String register, String list) throws SQLException
     {
         if (_subscribeDAO.numberAlreadyExists(phoneNumber, list))
         {
Index: main/plugin-sms/src/org/ametys/plugins/sms/service/SubscribeGenerator.java
===================================================================
--- main/plugin-sms/src/org/ametys/plugins/sms/service/SubscribeGenerator.java	(revision 29419)
+++ main/plugin-sms/src/org/ametys/plugins/sms/service/SubscribeGenerator.java	(working copy)
@@ -30,7 +30,6 @@
 import org.apache.commons.lang.StringUtils;
 import org.xml.sax.SAXException;
 
-import org.ametys.plugins.repository.AmetysObject;
 import org.ametys.plugins.repository.AmetysObjectResolver;
 import org.ametys.plugins.sms.dao.JCRSubscribersList;
 import org.ametys.plugins.sms.dao.SubscriberListsDAO;
Index: main/plugin-sms/src/org/ametys/plugins/sms/subscriber/PhoneNumbersListGenerator.java
===================================================================
--- main/plugin-sms/src/org/ametys/plugins/sms/subscriber/PhoneNumbersListGenerator.java	(revision 29419)
+++ main/plugin-sms/src/org/ametys/plugins/sms/subscriber/PhoneNumbersListGenerator.java	(working copy)
@@ -15,16 +15,13 @@
  */
 package org.ametys.plugins.sms.subscriber;
 
-import java.io.IOException;
 import java.util.HashMap;
 
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.generation.ServiceableGenerator;
 import org.apache.cocoon.xml.AttributesImpl;
 import org.apache.cocoon.xml.XMLUtils;
-import org.xml.sax.SAXException;
 
 import org.ametys.plugins.sms.dao.SubscribeDAO;
 
@@ -43,24 +40,31 @@
         _subscribeDAO = (SubscribeDAO) serviceManager.lookup(SubscribeDAO.ROLE);
     }
     
-    public void generate() throws IOException, SAXException, ProcessingException
+    public void generate() 
     {
         String idList = parameters.getParameter("id", "");
         
-        contentHandler.startDocument();
-        XMLUtils.startElement(contentHandler, "phoneNumbers");
-        
-        HashMap<String, String> listNumber = _subscribeDAO.getPhoneNumbersFromList(idList);
-        for (String number : listNumber.keySet())
+        try
         {
-            AttributesImpl attr = new AttributesImpl();
-            attr.addCDATAAttribute("value", number);
-            attr.addCDATAAttribute("date", listNumber.get(number));
-            XMLUtils.createElement(contentHandler, "phoneNumber", attr);
+            contentHandler.startDocument();
+            XMLUtils.startElement(contentHandler, "phoneNumbers");
+            
+            HashMap<String, String> listNumber = _subscribeDAO.getPhoneNumbersFromList(idList);
+            for (String number : listNumber.keySet())
+            {
+                AttributesImpl attr = new AttributesImpl();
+                attr.addCDATAAttribute("value", number);
+                attr.addCDATAAttribute("date", listNumber.get(number));
+                XMLUtils.createElement(contentHandler, "phoneNumber", attr);
+            }
+            
+            XMLUtils.endElement(contentHandler, "phoneNumbers");
+            contentHandler.endDocument();
         }
-        
-        XMLUtils.endElement(contentHandler, "phoneNumbers");
-        contentHandler.endDocument();
+        catch (Exception e)
+        {
+            getLogger().error("An error occurred while generating the list of phone numbers", e);
+        }
     }
 
 }
