On Wed, May 1, 2013 at 1:23 AM, Behrooz Nobakht <nob...@gmail.com> wrote: > More clearly, the intention is to be able to distinguish exceptions from > Apache Wicket and other frameworks and not really handle them.
for what purpose? an unhandled exception is an unhandled exception... > For > instance, there can be two exceptions: MarkupException and > CouldNotLockPageException. Both are in the context of Apache Wicket, > however, we actually need to "two" checks to determine either. If they > inherited a common parent class, it needed "one" check. > > I do not want to say that Apache Wicket should have done this. I first want > to understand why this design decision has been made. because we could not come up with a good usecase for having a common parent. in any case there would have to be two parents - one for checked and one for unchecked exceptins. which means that both would have to implement some kind of a tagging interface to allow a single instanceof check. but without a valid usecase why do this? if you really want to know you can see if the exception class lives in the org.apache.wicket.* package, and if it does its a wicket exception. -igor > > > > > On Wed, May 1, 2013 at 10:04 AM, Igor Vaynberg <igor.vaynb...@gmail.com>wrote: > >> what is the purpose of knowing whether an exception is a wicket >> exception or something from further down the stack? >> >> eg how would you handle a runtime exception that came from within >> java.lang.String differently then the one that came from Wicket or the >> one that came from the servlet api? >> >> -igor >> >> On Wed, May 1, 2013 at 12:23 AM, Behrooz Nobakht <nob...@gmail.com> wrote: >> > Hello, >> > >> > I've been working on an error page in Apache Wicket and came across a >> > general pattern in Apache Wicket and I'd like to understand the reason >> for >> > it. >> > >> > Exceptions in Apache Wicket do not have a single class hierarchy; i.e. >> > there are exceptions that eventually extend "WicketRuntimeException" but >> > they are also many others that start either from "RuntimeException" or >> > "Exception". I could guess for the reasons for "checked" exceptions but >> why >> > did *not* Apache Wicket introduce exception classes that all inherit >> from >> > a single exception class? >> > >> > A direct side effect of this design decision is that the check (e >> > instanceof WicketRuntimeException) cannot give an indication if the >> > exception is actually an exception raised by Wicket and need separate >> > checks for different concerns. >> > >> > Thanks in advance for your explanations. >> > >> > Regards, >> > Behrooz >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > > -- > -- Behrooz Nobakht --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org