You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org> on 2010/05/01 01:33:53 UTC

[jira] Closed: (TAP5-1032) Reporting validation exceptions by throwing an exception is bad form: allow for returning a value instead

     [ https://issues.apache.org/jira/browse/TAP5-1032?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAP5-1032.
--------------------------------------

    Resolution: Invalid

Basically, we are using exceptions as a form of covariant return value; ideally we should have a different API where the methods are void but produce side effects by invoking methods on an object passed in (one method for a succesfully translated value, another method when there's an error). For the meantime, we'll have to leave it as it is.

> Reporting validation exceptions by throwing an exception is bad form: allow for returning a value instead
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1032
>                 URL: https://issues.apache.org/jira/browse/TAP5-1032
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.0
>            Reporter: Howard M. Lewis Ship
>
> From the Dept. Of "We did this in T4 and didn't know it was brain damaged then." ... various APIs related to translation and validation work by throwing a ValidationException which is nothing more than a wrapper around an error message string. It would be nice to allow, in some compatible way, allow methods to simply return the exception, or even just the string for the exception, rather than throwing an exception, which is very inefficient.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.