CMS 3D CMS Logo

NoDataException Class Reference

Description: An exception that is thrown whenever data was not available in the Frame. More...

#include <Exception/interface/NoDataException.h>


Detailed Description

Description: An exception that is thrown whenever data was not available in the Frame.

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)
which are just shorthand ways of writing
       NoDataException<FAXXX<type>::contents>
E.g.
       NO_ITEM_DATA_EXCEPTION(DBEventHeader)
is the same as writing
       NoDataException<Item<DBEventHeader>::value_type>

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.


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:28:59 2009 for CMSSW by  doxygen 1.5.4