From: Ron F. <ro...@us...> - 2006-06-20 17:34:24
|
Update of /cvsroot/nsclspectcl/SpecTcl/Sorter In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv12002/Sorter Modified Files: Tag: SpecTcl-3-1-maintenance Histogrammer.cpp Log Message: Catch exceptions while histogramming event lists. Index: Histogrammer.cpp =================================================================== RCS file: /cvsroot/nsclspectcl/SpecTcl/Sorter/Histogrammer.cpp,v retrieving revision 5.5 retrieving revision 5.5.2.1 diff -C2 -d -r5.5 -r5.5.2.1 *** Histogrammer.cpp 18 Apr 2006 20:27:28 -0000 5.5 --- Histogrammer.cpp 20 Jun 2006 17:34:21 -0000 5.5.2.1 *************** *** 19,23 **** // Header Files: ! #include "Histogrammer.h" #include "DictionaryException.h" #include "EventList.h" --- 19,24 ---- // Header Files: ! #include "Histogrammer.h" ! #include <Exception.h> #include "DictionaryException.h" #include "EventList.h" *************** *** 321,338 **** // event or the end of the vector terminates. // ! CEventListIterator i; ! CEventListIterator e = rEvents.end(); ! for(i = rEvents.begin(); i != e; i++) { ! CEvent* pEvent = *i; ! if(pEvent) { ! nEvents++; ! operator()(*pEvent, ! nSpectra, pSpectra, ! nGates, pGates); ! } ! else { ! break; } } delete []pGates; delete []pSpectra; --- 322,356 ---- // event or the end of the vector terminates. // ! try { ! CEventListIterator i; ! CEventListIterator e = rEvents.end(); ! for(i = rEvents.begin(); i != e; i++) { ! CEvent* pEvent = *i; ! if(pEvent) { ! nEvents++; ! operator()(*pEvent, ! nSpectra, pSpectra, ! nGates, pGates); ! } ! else { ! break; ! } } } + catch (CException& e) { + cerr << "Exception caught while histogramming events: " + << e.ReasonText() << " while " << e.WasDoing() <<endl; + } + catch (string msg) { + cerr << "String exception caught while histogramming events: " + << msg << endl; + } + catch (const char* msg) { + cerr << "Char* exception caught while histogramming events: " + << msg <<endl; + } + catch (...) { + cerr << "Unexpected exception type caught while histogramming events.\n"; + } delete []pGates; delete []pSpectra; |