CMS 3D CMS Logo

ConvertHandle.cc
Go to the documentation of this file.
4 
5 namespace edm {
6  namespace handleimpl {
7  static std::shared_ptr<HandleExceptionFactory> s_invalidRefFactory =
8  makeHandleExceptionFactory([]() -> std::shared_ptr<cms::Exception> {
9  std::shared_ptr<cms::Exception> whyFailed =
10  std::make_shared<edm::Exception>(errors::InvalidReference, "NullPointer");
11  *whyFailed << "Handle has null pointer to data product";
12  return whyFailed;
13  });
14 
15  std::shared_ptr<HandleExceptionFactory> makeInvalidReferenceException() { return s_invalidRefFactory; }
16 
17  void throwConvertTypeError(std::type_info const& expected, std::type_info const& actual) {
18  throw Exception(errors::LogicError, "TypeMismatch")
19  << "edm::BasicHandle contains a product of type " << actual.name() << ".\n"
20  << "A type of " << expected.name() << "was expected.";
21  }
22  } // namespace handleimpl
23 } // namespace edm
static std::shared_ptr< HandleExceptionFactory > s_invalidRefFactory
Definition: ConvertHandle.cc:7
void throwConvertTypeError(std::type_info const &expected, std::type_info const &actual)
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
HLT enums.
std::shared_ptr< edm::HandleExceptionFactory > makeInvalidReferenceException()