--- "Andreas L. Delmelle" <[EMAIL PROTECTED]>
wrote:

>
> You might want to try searching Xalan source code
> BTW: I don't think Xalan's
> actually throwing them anywhere, it merely *uses*
> them in the sense of
> 'catch and possibly throw a TransformerException' or
> define a method with
> 'throws SAXParseException' because the method in
> question contains
> instructions that might throw one.
> 

Yes, I did not do my homework so much on this one.

> > try {
> >   driver.run();
> > } catch (SAXParseException) {
> >     // tell user there's a bug in the stylesheet
> > } catch (FileNotFoundException) {
> >     // tell user a file can't be found
> > } catch (Exceptiion) {
> >     // anything else
> > }
> 
> This embedded usage argument seems a bit out of
> place... IMHO, embedded
> users shouldn't even *have* to make the distinction
> between SPE or FNFE
> themselves 

But they *want* to make that distinction, so they have
a list of files they need to make visible, as well as
a list of bugs that they need to fix in their
stylesheet.  I guess we'll just have to agree to
disagree on this issue.

Personally, if I'm running Xalan, I just want a list
of files that it can't find (say, imported or included
files).  Also, if there are parsing errors, I would
want those to be handled separately.  I really don't
care where within Xalan these bugs became first
apparent.


--they should just be able to catch a
> FOPException, which would
> in turn give them access to all they need to know.
> So, where you say: 'catch an FNFE and tell the user
> a file can't be found',
> I think it would be better if FOP just sent the
> message 'that a file was not
> found', and the embedded user just needs to get this
> message from
> FOPException and send it to a logger of his/her
> choice or deal with the
> error as he/she pleases, 
> but he/she certainly
> shouldn't have to deal with
> SPE's or FNFE's directly.
> 

They wouldn't if they just caught a generic Exception
as follows:

try {
  fop.run();
} catch (Exception e) {
  ...
}

But if they want to have a different type of message
for FNF errors, validation/parsing errors, they can
then split them out into multiple catch blocks, with
information more pertinent for each type of error.

Thanks,
Glen

Reply via email to