[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://www.itk.org/pipermail/insight-developers/attachments/20140114/3b26cf0c/attachment.html>
More information about the Insight-developers
mailing list