cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <u....@cbim.it>
Subject Re: [VOTE] Make ProcessingException extend CascadingRuntimeException
Date Fri, 16 Apr 2004 17:05:14 GMT
Guido Casper wrote:
> Ugo Cei wrote:
> 
>> WebDAVRepository.java (swallowed):
>>
>>   } catch (ProcessingException pe) {
>>     this.getLogger().error("Error saving dom to: " + this.repoBaseUrl 
>> + uri, pe);
>>   }
>>
>> WebDAVRepositoryPropertyHelper.java (swallowed):
>>
>>   } catch (ProcessingException pe) {
>>     this.getLogger().error("Error serializing node " + value, pe);
>>   }
> 
> 
> Ehm, I didn't follow all the discussions very closely, but if you want
> to remove something please be aware that these Exceptions are not just
> swallowed (don't know about the others) since after the catch clause
> follows a "return false;"

Indeed, we should carefully check every one of the samples I have 
pasted, before changing them. Particularly those that don't rethrow an 
exception.

At the very least, we can say that the usage of exceptions in this case 
looks suspiciously like an instance of controlling the flow of the 
application with exceptions.

The problem is that the call that mandated the use of the "catch" might 
fail and throw a runtime exception (say, a NPE) instead. If you want the 
call to setProperty to always fail graciously, you'd better 
catch(Exception) instead, don't you agree?

	Ugo


Mime
View raw message