Hi All!
I use an enum as activation context parameter. Unfortunately in case the
enum changes or more likely the user has a typo in the url Tapestry is
unable to coerce the url param to enum and fails by throwing an
exception (fair enough). Instead of using onActivate parameters I
switched to EventContext to get fine grained control here by simply
catching the exception when coercing the enum from a given event context
value. I wonder if there es a more elegant solution currently build in?
If not what do you think about:
a) can't we create a new Tapestry annotation like
"CoerceExceptionDefaultsToNull" or something similar to allow this
annotation for parameters in onActivate (I know we can not limit it to
onActivate, but...) and supress the original exception (maybe not that
developer friendly). This introduces "if (null == xyz)" cascades but at
least we won't see an exception at the client side.
or
b) a callback like "Object onActivationCoercionError(final Object value,
final Class destinationClass, final Exception e)" to make the developer
aware of problems, allow providing a default value and Tapestry
continues normally by calling the best fitting onActivate method afterwards?
Maybe EventContext is the route to go for proper error handling, but my
gut feeling is we are loosing much of Tapestry's onActivation magic.
Any thoughts?
Jens
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org