ATLAS Offline Software
ReturnCheck.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef XAODROOTACCESS_TOOLS_RETURNCHECK_H
8 #define XAODROOTACCESS_TOOLS_RETURNCHECK_H
9 
10 // ROOT include(s):
11 #include <TError.h>
12 
13 // Local include(s):
16 
26 #define RETURN_CHECK( CONTEXT, EXP ) \
27  do { \
28  const auto result = EXP; \
29  if( ! result.isSuccess() ) { \
30  ::Error( CONTEXT, XAOD_MESSAGE( "Failed to execute: %s" ), \
31  #EXP ); \
32  return result; \
33  } \
34  } while( false )
35 
36 #endif // XAODROOTACCESS_TOOLS_RETURNCHECK_H
Message.h
StatusCode.h