Big +1 for the FOPException subclasses. However, I wonder if
FOPException should have SAXException as its baseclass. Almost all FOP
exceptions will probably result in SAXExceptions as the whole processing
occurs between startDocument() and endDocument() SAX events, but most
FOP exceptions are not really SAX-related. I can't pinpoint it, yet, but
it somehow doesn't feel right. This is not a veto to this change. I'm
only stating what I'm thinking. Consider it a +0 for the proposed
hierarchy. I agree however, that SAXParseExceptions shouldn't be thrown
from within FOP.

On 26.10.2004 20:18:15 Finn Bock wrote:
> I would like to make some changes to the exceptions used in tree building.
> First, I dislike throwing SAXParseException from within FOP. In my 
> opinion SAXParseException are for reporting problems during the parsing 
> of XML, not for reporting subsequent problems with the FO tree.
> Second, the exceptions used in FOP should form a structure where 
> concrete subclass exception are thrown and a common superclass can be 
> used for catching all the different exceptions.
> My proposal for the exception hierarchy look like this:
> - SAXException
>    - FOPException
>      - ValidateException
>      - PropertyException
> Putting all our exceptions into one hierarchy that inherit from 
> SAXException helps reduce the number of wrapped exception.
> I've uploaded a patch which changes the FO tree building and property 
> code. The benefit of the patch is the reduced number of blind catches:
>      } catch (XXXException e) {
>          // log.error(e);
>      }
> Any objections?

Jeremias Maerki

Reply via email to