[jdom-interest] [Fwd: [Fwd: More explicit Exceptions ?]]

Christophe D. Laprun chris.laprun at nist.gov
Fri Jun 23 15:24:33 PDT 2000


"Christophe D. Laprun" wrote:

> After having taken a closer look at the code of SAXBuilder.build (which
> created the exception when using SAXBuilderDemo), it seems that adding
> the file name could be done using the getSystemId method of
> org.sax.xml.InputSource and modify the code of
> SAXBuilder.build(InputSource) (starting line 227):
> 
> throw new JDOMException(e.getMessage(),
>                     new JDOMException("Error on line " +
> p.getLineNumber() +
>                                       " of XML document: " +
> p.getMessage()));
> 
> by something like:
> throw new JDOMException(e.getMessage(),
>                     new JDOMException("Error on line " +
> p.getLineNumber() +
>                                       " of XML document " +
> in.getSystemId() + ": " + p.getMessage()));
> 
> I guess there are other places where the modification would make sense
> too.
> 
> What do you think ?

Oops, that doesn't work since (and I should have known better!) in
refers to the document passed to SAXBuilderDemo and not necessarily the
file that cause the parsing error... Sorry for the spamming. Any idea if
it is possible or not to report the actual document that generated the
parsing error ?

Chris

-- 
Christophe Laprun    [Ingenieur ISIMA, France / Guest researcher @NIST]
web: http://www.nist.gov/speech/laprunch.htm
email: chris.laprun at nist.gov
phone: (301) 975 3191             fax: (301) 670 0939
--
The universe seems neither benign nor hostile, merely indifferent -
Sagan



More information about the jdom-interest mailing list