You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ville <vi...@cerion.fi> on 2011/11/24 09:04:31 UTC

TAP5-1425

Hi,

https://issues.apache.org/jira/browse/TAP5-1425 was fixed, but it breaks a
lot of existing functionality.

Resource has method exists(), but what is the point of this method if the
service throws RuntimeException when loading resources that doesn't exist?

This is from Tap5Jquery:
if(this.assetSource.getExpandedAsset(path).getResource().exists()) {
    return this.assetSource.getExpandedAsset(path);
}
return null;

Do we now have to catch RuntimeException and return null if such is thrown?
We should atleast have ResourceNotFoundRuntimeException?

 - Ville

--
View this message in context: http://tapestry.1045711.n5.nabble.com/TAP5-1425-tp5019523p5019523.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: TAP5-1425

Posted by Christian Riedel <cr...@googlemail.com>.
..my fix for this was to type-coerce the path into a resource and call .exists() on it. 
the runtime exception was thrown from the assetSource.getExpandedAsset method in this case.

Am 24.11.2011 um 09:04 schrieb Ville:

> Hi,
> 
> https://issues.apache.org/jira/browse/TAP5-1425 was fixed, but it breaks a
> lot of existing functionality.
> 
> Resource has method exists(), but what is the point of this method if the
> service throws RuntimeException when loading resources that doesn't exist?
> 
> This is from Tap5Jquery:
> if(this.assetSource.getExpandedAsset(path).getResource().exists()) {
>    return this.assetSource.getExpandedAsset(path);
> }
> return null;
> 
> Do we now have to catch RuntimeException and return null if such is thrown?
> We should atleast have ResourceNotFoundRuntimeException?
> 
> - Ville
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/TAP5-1425-tp5019523p5019523.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


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