[ITK Community] [Insight-developers] ObjectFactoryBase throwing uncaught exceptions

Brian Helba brian.helba at kitware.com
Tue Jan 14 16:24:41 EST 2014


Hello all,

Reviewing some of Coverity's results, I've noticed that there are 283
"Uncaught exception" defects, all triggered by the same code in
Modules/Core/Common/src/itkObjectFactoryBase.cxx.

Much of the library and factory loading code in ObjectFactoryBase uses the
itkGenericExceptionMacro to throw exceptions in cases of unexpected
conditions or errors. Obviously any user that doesn't enclose their entire
program in a try block could theoretically have a program crash due to an
uncaught exception.

The question is: is there a use case where a user would want to catch and
respond to these sort of library and factory load errors and attempt to
recover from them? If not, then the exceptions could and perhaps should be
replaced with a simple abort.

Looking forward to your feedback,
Brian

-- 
Brian Helba
Medical Imaging
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140114/3b26cf0c/attachment-0002.html>
-------------- next part --------------
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-developers


More information about the Community mailing list