#include <Exception/interface/NoDataException.h>
Usage: NoDataException<> is thrown whenever an extract call fails because the type of data being extract was not available in the Frame.
If your program should continue even if the extract call fails, you should catch this exception.
try { Item<DBEventHeader> eventHeader; extract(iFrame.record(Stream::kBeginRun), eventHeader); report(INFO, kFacilityString) << "run # " << eventHeader->runNumber() << "event # " << eventHeader->number() << std::endl; } catch(NoDataException<Item<DBEventHeader>::contents> &iException) { report(WARNING, kFacilityString) << iException.what() << std::endl; }
To make it easier to catch exceptions, all of the FAXXX types provide C preprocessor macros of the form
NO_XXX_DATA_EXCEPTION(type)
NO_ITEM_DATA_EXCEPTION(DBEventHeader)
NOTE: NoDataException<> is only thrown when the data is unavailable. If the data should have been available but a problem occured while obtaining the data, then a different type of exception will be thrown.
To catch ALL possible exceptions that can occur from the Data Access system you should catch exceptions of the type DAExceptionBase.