[Newbies] Changing error message

Damien Cassou damien.cassou at laposte.net
Mon Aug 21 16:24:35 UTC 2006


cdrick wrote:
> really interesting...
> 
> If I remember well I've seen Stephan saying that it's not always good 
> practises tu use exception handling ...
> 
> what are the limits ? when to use or when not to use ...
> 
> It seems appropriate to me when there is a user entry to control it and 
> avoid human input error (WAValidationDecoration in seaside uses 
> WAValidationNotification for the Store example for instance) therwise, I 
> don't really see...


I often use error handling to detect errors in parameters in the model. 
Most of the time, I assume parameters are valid but sometimes I must be 
sure. Then, if the parameter is not valid I throw (or raise) an 
exception (not using #error: but a self-made subclass of Error). The 
error can be catched when there is something to do or you can let it 
notify the user about a problem (use a string describing clearly the 
problem).


More information about the Beginners mailing list