FailingProducer_module.cc
Go to the documentation of this file.
4 
5 namespace arttest {
6  class FailingProducer;
7 }
8 
9 //--------------------------------------------------------------------
10 //
11 // throws an exception.
12 // Announces an IntProduct but does not produce one;
13 // every call to FailingProducer::produce throws an art::Exception
14 //
16 public:
18  {
19  produces<arttest::IntProduct>();
20  }
21 
22 private:
23  void produce(art::Event& e) override;
24 };
25 
26 void
28 {
29  // We throw an edm exception with a configurable action.
31  << "Intentional 'ProductNotFound' exception for testing purposes\n";
32 }
33 
static const double ps
Definition: Units.h:103
EDProducer()=default
const double e
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:68
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
void produce(art::Event &e) override
FailingProducer(fhicl::ParameterSet const &ps)