Velocity suppressing all errors

Hi,

I wrote a small velocity script containing #set($bytes = xwiki.getUrlContentAsBytes(...)). The resource I want to access currently uses TLS (self signed cert) and authentication (not basic), so I expected this to fail. I just wanted to now what with what error it fails (SSL Trust or Authentication issue).
What surprised me is that there are no errors reported. While I hoped that it wouldn’t throw an exception, I expected it to report an error in catalina.out.

Is there any way to make velocity write errors to catalina.out?
Will there be any error (thrown or reported) if I switch to groovy?

Thanks in advance.

Best regards,

rbr

This does not have much to do with Velocity.

As far as I can see in the code XWiki#getURLContentAsBytes simply ignore the HTTP error code and always return the response body.

I don’t have any other standard API in mind for this need so you might need to use Groovy (or some other advanced language) to have more control over the HTTP client and better error reporting. If you really need to use Velocity you could also provide some HTTP client ScriptService.