From ebb9e98ce99f5882b68e3fdffeb06833f3c67209 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Tue, 29 Oct 2024 08:51:41 +0100 Subject: [PATCH] Improve exception --- k4FWCore/include/k4FWCore/DataHandle.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/k4FWCore/include/k4FWCore/DataHandle.h b/k4FWCore/include/k4FWCore/DataHandle.h index ef130970..6d148226 100644 --- a/k4FWCore/include/k4FWCore/DataHandle.h +++ b/k4FWCore/include/k4FWCore/DataHandle.h @@ -26,6 +26,7 @@ #include #include +#include /** * Specialisation of the Gaudi DataHandle @@ -123,8 +124,8 @@ template const T* DataHandle::get() { return static_cast(ptr->getData().get()); } std::string errorMsg("The type provided for " + DataObjectHandle>::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); } //---------------------------------------------------------------------------