You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Adam Zimowski <zi...@gmail.com> on 2008/04/25 12:37:05 UTC

T5: ComponentSource throws undeclared exception

I'm not sure if this is a bug or simply missed javadoc within
ComponentSource interface, but as stated:

public interface ComponentSource
{
    /**
     * Gets a component by its complete id.
     *
     * @param componentId complete component id
     * @return the component
     * @throws IllegalArgumentException if the component can not be found
     * @see ComponentResourcesCommon#getCompleteId()
     */
    Component getComponent(String componentId);

...
}

calling getComponent(..) one may expect IllegalArgumentException be
thrown if component cannot be found. However, the exception being
thrown instead is TapestryException which obviously wasn't in my catch
block so I got the error page. The simple fix of catching
TapestryException handled the issue properly, but I'm wondering if
ComponentSourceImpl should catch TapestryException and rethrow it as
IllegalArgumentException, or should the interface have
TapestryException in its @throws.

I traced code in debugger and TapestryException is throwed from:

PropBinding.get

Tapestry 5.0.11

-adam

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org