> -----Original Message-----
> From: Agar, Robert [mailto:[EMAIL PROTECTED]
>

Hi,

> I have FOP running embedded in a java program. How do I make it
> throw an exception on an error, rather than just logging it?
>
> The particular error I want it to fail on is this:
> [ERROR] Error while creating area : Error with image URL:
> Images\test.jpeg (The system cannot find the path specified) and
> no base URL is specified
>

In maintenance (FOP 0.20.5), the stated error message appears in
org.apache.fop.fo.flow.ExternalGraphic.java (line: 296 and following --catch
MalformedURLException or FopImageException).

AFAICT no additional Exception is thrown, most likely because an image not
being found can hardly be considered a 'fatal' error --rendering can
continue, just leaving out the offending fo:external-graphic element-- and
the XSL-FO Rec prescribes nothing in particular for dealing with an invalid
'src' attribute, but it seems feasible enough to modify the code so that
when the MalformedURLException or FopImageException is caught, it throws a
FOPException --which, IIUC, should be enough to send the signal to break off
any further processing--, and when you catch that Exception in your app, you
can then provide the necessary error-handling code for it.


Greetz,

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to