Hi Bertrand,

Am 06.07.15 um 14:25 schrieb Bertrand Delacretaz:
Hi Sandro,

On Mon, Jul 6, 2015 at 2:00 PM, Sandro Boehme <sandro.boe...@gmx.de> wrote:
Am 06.07.15 um 11:16 schrieb Bertrand Delacretaz:
...debugging the
SlingServletResolver.handleError method should help as well....

The processing flow does not seem to go through this method as the debugger
does not stop there....

The below example works for me, comparing with what you are doing might help?

There are integration tests for this in ErrorHandlingTest [1] but they
dont seem to test the resource-specific error handlers - if you can
add some tests for that while investigating that would be great, of
course.
I'd be happy if I could do that.


$ curl -u admin:admin -Fsling:resourceType=xyz http://localhost:8080/apps/xyz
...
     <title>Content created /apps/xyz</title>
...
$ echo '<% if(true) throw new IllegalStateException("this cannot
work"); %>' > /tmp/xyz.jsp
$ curl -u admin:admin -T/tmp/xyz.jsp http://localhost:8080/apps/xyz/xyz.jsp
$ echo 'This is the custom error handler' > /tmp/IllegalStateException.jsp
$ curl -u admin:admin -T /tmp/IllegalStateException.jsp
http://localhost:8080/apps/xyz/IllegalStateException.jsp
$ curl http://localhost:8080/apps/xyz.html
This is the custom error handler
Yeah, it works for me as well! Thanks for this error page example it runs through the handleError() methods as you wrote. I'll use the time between some family celebrations to compare with my code and let you and the list (archive) know about the results.

Thanks again!

Sandro



-Bertrand

[1] 
https://svn.apache.org/repos/asf/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/resolver/errorhandler/ErrorHandlingTest.java


Reply via email to