Rethrow an exception like in C++?

Rob T alanb at ucora.com
Fri Mar 8 11:24:35 PST 2013


On Friday, 8 March 2013 at 18:56:38 UTC, Andrej Mitrovic wrote:
> On 3/8/13, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
>> In both cases, you're telling it to catch everything.
>
> Also, catch points should be rare, especially the ones which 
> catch
> base types like Exception or even Error or Throwable. The 
> problem is
> not the syntax, but the way people use exceptions. Pokemon 
> exception
> handling is a bad idiom.

I've given this a fair amount of thought in the past, and I've 
have extensive experience with making good use out of error 
handling for managing large code bases that require near real 
time automated monitoring for defects and rapid repair. My needs 
may be much more unique than most.

What I will say, is that unless you use an exception handler, and 
have a well designed exception handling system in place, you will 
have plenty of problems making use out of frequent try/catch 
blocks. They may in fact cause more problems than they solve. In 
a small non essential code base, it may seem pointless as well. 
So beware that what is good or bad depends entirely on the 
implementation and the needs.

--rt


More information about the Digitalmars-d-learn mailing list