Ignore:
Timestamp:
Apr 20, 2011, 5:17:02 AM (13 years ago)
Author:
anthony43
Message:

huge refactoring to introduce JiwigoException : a generic exception encapsulating low level exceptions (IOException, ProxyAuthentication, etc...)
The aim is to have, on the consumer side, just one exception to catch them all.
this refactoring may need a code review to check the changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/impl/CategoryDaoImpl.java

    r9919 r10505  
    1717import fr.mael.jiwigo.transverse.enumeration.MethodsEnum;
    1818import fr.mael.jiwigo.transverse.exception.FileAlreadyExistsException;
     19import fr.mael.jiwigo.transverse.exception.JiwigoException;
    1920import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException;
    2021import fr.mael.jiwigo.transverse.session.SessionManager;
     
    5354     * @param recursive true : recursive listing of the categories
    5455     * @return the list of categories
     56     * @throws JiwigoException
    5557     * @throws IOException
    5658     * @throws ProxyAuthenticationException
    5759     */
    58     public List<Category> list(boolean recursive) throws IOException, ProxyAuthenticationException {
     60    public List<Category> list(boolean recursive) throws JiwigoException {
    5961        Document doc = sessionManager.executeReturnDocument(MethodsEnum.LISTER_CATEGORIES.getLabel(), "recursive",
    6062                String.valueOf(recursive));
     
    9294     * @return true if the category is successfully created
    9395     * @throws ProxyAuthenticationException
     96     * @throws JiwigoException
    9497     */
    95     public boolean create(Category category) throws ProxyAuthenticationException {
     98    public boolean create(Category category) throws JiwigoException {
    9699        try {
    97100            if (category.getDirectParent() != null) {
     
    102105                        "name", category.getName()));
    103106            }
    104         } catch (IOException e) {
    105             LOG.error(Tools.getStackTrace(e));
    106107        } catch (FileAlreadyExistsException e) {
    107108            LOG.error(Tools.getStackTrace(e));
     109            throw new JiwigoException(e);
    108110        }
    109         return false;
    110111    }
    111112
Note: See TracChangeset for help on using the changeset viewer.