birt icon indicating copy to clipboard operation
birt copied to clipboard

response body from image+url request for better error reporting

Open mithrandirii opened this issue 3 weeks ago • 3 comments

we implemented a birt 4.21 report server with spring boot 3.5 and openjdk 21. the report service has a rest api to render birt reports in pdf.

in this reports we are using dynamic image items with http url. if a http request to an image url fails we only get a request failed log message. but we need the more detailed error message from the response body (json) of the image request.

now my question is: is there any chance to extend, intercept, or override the part which does the http request to forward the response body to the log message if a request fails?

mithrandirii avatar Dec 01 '25 16:12 mithrandirii

hard to say without knowing your code... but maybe you can write your own ImageHandler. Something like

PDFRenderOption pdfOptions = new PDFRenderOption();
...
pdfOptions.setImageHandler(new MyOwnHTMLServerImageHandler());   
....

That may be one possibility, but perhaps there are even better ones.

chille716 avatar Dec 01 '25 18:12 chille716

You might consider to contribute improved logging to BIRT itself:

https://github.com/eclipse-birt/birt?tab=readme-ov-file#create-a-birt-development-environment

merks avatar Dec 03 '25 07:12 merks

I tried to implement my own recource locator and also my own image handler. both didn't work for me, because we use http urls for the images and the url open is done directly in RecourceLocationWrapper.java. Thats the reason i opened a pull-request to extend the RecourceLocationWrapper directly

mithrandirii avatar Dec 15 '25 15:12 mithrandirii