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 = makeHandleExceptionFactory([]()->std::shared_ptr<cms::Exception> {
8  std::shared_ptr<cms::Exception> whyFailed = std::make_shared<edm::Exception>(errors::InvalidReference, "NullPointer");
9  *whyFailed << "Handle has null pointer to data product";
10  return whyFailed;
11  });
12 
13  std::shared_ptr<HandleExceptionFactory> makeInvalidReferenceException() {
14  return s_invalidRefFactory;
15  }
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  }
23 }
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()