On an author instance, CQ WCM Debug Filter is enabled by default. This always results in the response code 200. The default error handler responds by writing the full stack trace to the response.

On a publish instance, CQ WCM Debug Filter is always disabled (even if configured as enabled).

How to Customize Pages shown by the Error Handler

You can develop your own scripts to customize the pages shown by the error handler when an error is encountered. Your customized pages will be created under /apps and overlay the default pages (that are under /libs).

Otherwise, the response code is set to 500, but the 500.jsp script is not executed.

To handle 500 errors, the file name of the error handler script must be the same as the exception class (or superclass). To handle all such exceptions you can create a script /apps/sling/servlet/errorhandler/Throwable.jsp or /apps/sling/servlet/errorhandler/Exception.jsp.

Hoiatus.

On an author instance, CQ WCM Debug Filter is enabled by default. This always results in the response code 200. The default error handler responds by writing the full stack trace to the response.

For a custom error-handler, responses with code 500 are needed - so the CQ WCM Debug Filter needs to be disabled. This ensures that the response code 500 is returned, which in turn triggers the correct Sling error-handler.

On a publish instance, CQ WCM Debug Filter is always disabled (even if configured as enabled).