Dispatcher is not catching 500 errors
Hi,
I´m in an AEM cloud project, I´m trying to configure the dispatcher to redirect to specific error pages (client don´t want to handle this on sling). I want to handle errors 404 and 500 for now.
I have the next config in dispatcher:
<IfModule disp_apache2.c>
# Enabled to allow rewrites to take affect and not be ignored by the dispatcher module
DispatcherUseProcessedURL On
# Default setting to allow all errors to come from the aem instance
DispatcherPassError 1
</IfModule>
# Error pages handling
# Set ERRORDOCS based on URL
SetEnvIfNoCase Request_URI "^/([a-z]{2})/.*" ERRORDOCS=$1/errors
# Set to default if not exists
SetEnvIfNoCase ERRORDOCS ^\s*$ ERRORDOCS=errors
<LocationMatch />
# Redirect 500 y 404 errors to the corresponding pages based on ERRORDOCS
ErrorDocument 500 /%{ENV:ERRORDOCS}/500
ErrorDocument 404 /%{ENV:ERRORDOCS}/404
</LocationMatch>
</VirtualHost>
The issue is that for 404 errors this config is working properly, redirecting me to the proper 404 page, but if I force a component inside a page to throw a NullPointer (for example) it is not working anymore. It is showing me the default cloud internal error page. However in the console I can see that it is actually resolving a 500. Attached example:

Has anyone any idea of what is happening, or has anyone facing something similar in the past? It seems that the dispatcher config of "ErrorDocument 500" is not catching this errors, I don´t know why. I would like any kind of help anyone can give me.
Thank you all!

