Am 06.07.15 um 15:20 schrieb Sandro Boehme:
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.
As a quick check I've added your error handler jsp to the resource folder and added the throw statement to my page. It works and shows the custom error page! Next I will check for the right exception and resource type in my case.

Best,

Sandro

Reply via email to