[
https://issues.apache.org/jira/browse/WICKET-1418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Peter Ertl updated WICKET-1418:
-------------------------------
Attachment: wicket-1418-no-catch-anymore.patch
After some research I come to the conclusion that the whole
try { /* ... /* } catch(WicketRuntimeException)
in MarkupContainer#onBeginRender() should be removed as it just makes no sense
and gives no extra value.
The only extra information we get is
"Error attaching this container for rendering"
Well, isn't that obvious when the method is interrupted by an exception?
Also there's a drawback in wrapping RuntimeException into another
WicketRuntimeException:
For example it's quite common to override the
WebRequestCycle#onRuntimeException() method to get custom error handling. for
example on foo.bar.DatabaseRuntimeException's you could show a wicket page
'DatabaseErrorPage'. Or imagine DataAccessExceptions from Spring JDBC which are
RuntimeExceptions, too.
wrapping runtime exceptions with additional WicketRuntimeException seems to
give no extra value but requires onRuntimeException (and probably other places
in code) to unwrap the exception again until we find the 'right one'.
It's seems that all runtime exceptions in the end are processed uniformely
anyway by RequestCycle#step() in line 1256 in trunk.
No distinction between RuntimeException and WicketRuntimeException.
So what is the whole catch-rethrow good for?
I vote for removing the exception handler!
> org.apache.wicket.MarkupContainer swallows AbortException
> ---------------------------------------------------------
>
> Key: WICKET-1418
> URL: https://issues.apache.org/jira/browse/WICKET-1418
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Reporter: Peter Ertl
> Assignee: Igor Vaynberg
> Attachments: bugtest.zip, wicket-1418-no-catch-anymore.patch,
> wicket-1418-pertl.patch, wicket-patch
>
>
> MarkupContainer#onBeforeRenderChildren() will catch exceptions of type
> org.apache.wicket.AbortException and remap them to a WicketRuntimeException.
> This is obviously wrong.
> For example when throwing a RestartResponseException the exception will be
> remapped to WicketRuntimeException and the response will not be restarted but
> the error page will be shown.
> I attached a usecase to demonstrate this bug.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.