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 const> const 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 const> 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
FunctorHandleExceptionFactory.h
edm::errors::InvalidReference
Definition: EDMException.h:39
edm::errors::LogicError
Definition: EDMException.h:37
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::makeHandleExceptionFactory
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
Definition: FunctorHandleExceptionFactory.h:45
EDMException.h
edm::handleimpl::throwConvertTypeError
void throwConvertTypeError(std::type_info const &expected, std::type_info const &actual)
Definition: ConvertHandle.cc:17
edm::handleimpl::s_invalidRefFactory
static const std::shared_ptr< HandleExceptionFactory const > s_invalidRefFactory
Definition: ConvertHandle.cc:7
ConvertHandle.h
edm::handleimpl::makeInvalidReferenceException
std::shared_ptr< edm::HandleExceptionFactory const > makeInvalidReferenceException()
Definition: ConvertHandle.cc:15
Exception
Definition: hltDiff.cc:246