response body from image+url request for better error reporting
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?
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.
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
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