Skip to content
Snippets Groups Projects
Commit 14424f4c authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'ool.StoreGate-20201030' into 'master'

StoreGate: Move some error reporting out of line.

See merge request atlas/athena!37795
parents ba5c238f a0508fd6
No related branches found
No related tags found
No related merge requests found
/* /*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef STOREGATE_READCONDHANDLE_H #ifndef STOREGATE_READCONDHANDLE_H
...@@ -27,6 +27,17 @@ ...@@ -27,6 +27,17 @@
namespace SG { namespace SG {
/**
* @brief Report a conditions container lookup failure.
* @param cc The conditions container.
* @param eid The time for which to search.
* @param The key corresponding to the conditions container.
*/
void ReadCondHandleNotFound (const CondContBase& cc,
const EventIDBase& eid,
const std::string& key);
template <typename T> template <typename T>
class ReadCondHandle { class ReadCondHandle {
...@@ -162,14 +173,7 @@ namespace SG { ...@@ -162,14 +173,7 @@ namespace SG {
if (m_obj != 0) return true; if (m_obj != 0) return true;
if ( ATH_UNLIKELY(!m_cc->find(m_eid, m_obj, &m_range)) ) { if ( ATH_UNLIKELY(!m_cc->find(m_eid, m_obj, &m_range)) ) {
std::ostringstream ost; ReadCondHandleNotFound (*m_cc, m_eid, m_hkey.objKey());
m_cc->list(ost);
MsgStream msg(Athena::getMessageSvc(), "ReadCondHandle");
msg << MSG::ERROR
<< "ReadCondHandle: could not find current EventTime "
<< m_eid << " for key " << m_hkey.objKey() << "\n"
<< ost.str()
<< endmsg;
m_obj = nullptr; m_obj = nullptr;
return false; return false;
} }
...@@ -212,14 +216,7 @@ namespace SG { ...@@ -212,14 +216,7 @@ namespace SG {
// pointer_type obj(0); // pointer_type obj(0);
const_pointer_type cobj(0); const_pointer_type cobj(0);
if (! (m_cc->find(eid, cobj) ) ) { if (! (m_cc->find(eid, cobj) ) ) {
std::ostringstream ost; ReadCondHandleNotFound (*m_cc, eid, m_hkey.objKey());
m_cc->list(ost);
MsgStream msg(Athena::getMessageSvc(), "ReadCondHandle");
msg << MSG::ERROR
<< "ReadCondHandle::retrieve() could not find EventTime "
<< eid << " for key " << m_hkey.objKey() << "\n"
<< ost.str()
<< endmsg;
return nullptr; return nullptr;
} }
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
/**
* @file StoreGate/src/ReadCondHandle.cxx
* @author scott snyder <snyder@bnl.gov>
* @date Oct, 2020
* @brief Out-of-line implementations for ReadCondHandle.
*/
#include "StoreGate/ReadCondHandle.h"
namespace SG {
/**
* @brief Report a conditions container lookup failure.
* @param cc The conditions container.
* @param eid The time for which to search.
* @param The key corresponding to the conditions container.
*/
void ReadCondHandleNotFound (const CondContBase& cc,
const EventIDBase& eid,
const std::string& key)
{
std::ostringstream ost;
cc.list(ost);
MsgStream msg(Athena::getMessageSvc(), "ReadCondHandle");
msg << MSG::ERROR
<< "ReadCondHandle::retrieve() could not find EventTime "
<< eid << " for key " << key << "\n"
<< ost.str()
<< endmsg;
}
} // namespace SG
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment