[Insight-developers] Arbitrary use of exception specifications?

Bradley Lowekamp blowekamp at mail.nih.gov
Mon May 18 17:47:15 EDT 2009


Some methods in itk have what seem to be like abitrary use of  
exception specifications such as:

void DataObject::PropagateRequestedRegion() throw  
(InvalidRequestedRegionError)

I was adding an exception to  
ImageFileReader::EnlargeOutputRequestedRegion, and then adding a test  
to catch it. But my program was being terminated instead of catching  
the exception. I should have known that this was what was occurring,  
but it took me entirely too long to track down.

Is there any reason for this behavior (explicit termination on  
unspecified exception)?
Is it desired that if an application encounters one of these  
exceptions, it should immediately terminate? (just imagine using  
something like slicer and this occurring)
If it's desired should it be used more?
should the exception specified methods just handle other exceptions?


========================================================
Bradley Lowekamp
Lockheed Martin Contractor for
Office of High Performance Computing and Communications
National Library of Medicine
blowekamp at mail.nih.gov


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090518/3f1f1fde/attachment.htm>


More information about the Insight-developers mailing list