I've worked quite a bit with exceptions in cocoon, so here are my 2c of wisdom.

Thanks for the tip. I think that we are not very consequent regarding how we handle exceptions. Some examples:


   protected void createDriver(String uri) throws XMLDBException {
      try {
      }
      catch (Exception e) {
         if (log.isInfoEnabled()) {
            log.info("Exception during creation of the Database", e);
         }
         throw new XMLDBException(ErrorCodes.INVALID_URI, uri, e);
      }
   }

    protected void initResources(Document document)
            throws XMLDBException {
        try {
        }
        catch (Exception e) {
            throw new XMLDBException(ErrorCodes.UNKNOWN_ERROR, e);
        }
    }

   public DOMParser() throws XindiceException {
      try {
      }
      catch ( Exception e ) {
         throw new XindiceException("Error creating parser", e);
      }
   }

   XindiceException is a somewhat generic exception.

Well, you get the picture.  And it's all over the place.

Do you have a strategy to fix this situation or other words of wisdom?

-Vladimir

--
Vladimir R. Bossicard
Apache Xindice - http://xml.apache.org/xindice



Reply via email to