Skip to content

Commit

Permalink
Improve exception
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Oct 29, 2024
1 parent d71edf0 commit ebb9e98
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions k4FWCore/include/k4FWCore/DataHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <GaudiKernel/AnyDataWrapper.h>
#include <type_traits>
#include <stdexcept>

/**
* Specialisation of the Gaudi DataHandle
Expand Down Expand Up @@ -123,8 +124,8 @@ template <typename T> const T* DataHandle<T>::get() {
return static_cast<const T*>(ptr->getData().get());
}
std::string errorMsg("The type provided for " + DataObjectHandle<DataWrapper<T>>::pythonRepr() +
" is different from the one of the object in the store.");
throw GaudiException(errorMsg, "wrong product type", StatusCode::FAILURE);
" is different from the one of the object in the store " + typeid(*dataObjectp).name());
throw std::runtime_error(errorMsg);
}

//---------------------------------------------------------------------------
Expand Down

0 comments on commit ebb9e98

Please sign in to comment.