The Gaudi Framework  master (37c0b60a)
ExceptionSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDISVC_EXCEPTIONSVC_H
12 #define GAUDISVC_EXCEPTIONSVC_H
13 // ============================================================================
14 // Include files
15 // ============================================================================
16 // GaudiKernel
17 // ============================================================================
19 #include <GaudiKernel/MsgStream.h>
20 #include <GaudiKernel/Service.h>
21 // ============================================================================
28 // ============================================================================
29 class ExceptionSvc : public extends<Service, IExceptionSvc> {
30 public:
32  StatusCode handle( const INamedInterface& o, const GaudiException& e ) const override;
33  StatusCode handle( const INamedInterface& o, const std::exception& e ) const override;
35  StatusCode handle( const INamedInterface& o ) const override;
37  StatusCode handleErr( const INamedInterface& o, const StatusCode& s ) const override;
39 public:
41  StatusCode initialize() override;
42 
43 public:
44  using extends::extends;
45 
46 private:
47  // default constructor is disabled
48  ExceptionSvc() = delete;
49  // copy constructor is disabled
50  ExceptionSvc( const ExceptionSvc& ) = delete;
51  // assignment operator is disabled
52  ExceptionSvc& operator=( const ExceptionSvc& ) = delete;
53  // process exceptions
54  virtual StatusCode process( const INamedInterface& o ) const;
55 
56 private:
57  enum Policy { ALL, NONE };
59 
62 
63  Gaudi::Property<std::string> m_mode_exc_s{ this, "Catch", "ALL" };
64  Gaudi::Property<std::string> m_mode_err_s{ this, "Errors", "NONE" };
65 };
66 
67 // ============================================================================
68 #endif // GAUDISVC_EXCEPTIONSVC_H
ExceptionSvc::process
virtual StatusCode process(const INamedInterface &o) const
Definition: ExceptionSvc.cpp:180
ExceptionSvc::m_mode_exc
Policy m_mode_exc
Definition: ExceptionSvc.h:60
std::exception
STL class.
ExceptionSvc::ExceptionSvc
ExceptionSvc(const ExceptionSvc &)=delete
ExceptionSvc::ReturnState
ReturnState
Definition: ExceptionSvc.h:58
gaudirun.s
string s
Definition: gaudirun.py:346
ExceptionSvc::RETHROW
@ RETHROW
Definition: ExceptionSvc.h:58
GaudiException
Definition: GaudiException.h:31
ExceptionSvc::m_mode_err
Policy m_mode_err
Definition: ExceptionSvc.h:60
ExceptionSvc::m_retCodesErr
std::map< std::string, ReturnState > m_retCodesErr
Definition: ExceptionSvc.h:61
ExceptionSvc::operator=
ExceptionSvc & operator=(const ExceptionSvc &)=delete
ExceptionSvc::RECOVERABLE
@ RECOVERABLE
Definition: ExceptionSvc.h:58
ExceptionSvc::initialize
StatusCode initialize() override
initialize the service
Definition: ExceptionSvc.cpp:40
IExceptionSvc.h
ExceptionSvc::m_retCodesExc
std::map< std::string, ReturnState > m_retCodesExc
Definition: ExceptionSvc.h:61
ExceptionSvc::handleErr
StatusCode handleErr(const INamedInterface &o, const StatusCode &s) const override
Handle errors.
Definition: ExceptionSvc.cpp:149
StatusCode
Definition: StatusCode.h:65
ExceptionSvc::handle
StatusCode handle(const INamedInterface &o, const GaudiException &e) const override
Handle caught GaudiExceptions.
Definition: ExceptionSvc.cpp:218
ExceptionSvc::ALL
@ ALL
Definition: ExceptionSvc.h:57
ExceptionSvc::ExceptionSvc
ExceptionSvc()=delete
no default constructor
ExceptionSvc::SUCCESS
@ SUCCESS
Definition: ExceptionSvc.h:58
ExceptionSvc::DEFAULT
@ DEFAULT
Definition: ExceptionSvc.h:58
ExceptionSvc::NONE
@ NONE
Definition: ExceptionSvc.h:57
std::map< std::string, ReturnState >
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
ExceptionSvc::m_mode_err_s
Gaudi::Property< std::string > m_mode_err_s
Definition: ExceptionSvc.h:64
Service.h
INamedInterface
Definition: INamedInterface.h:25
ExceptionSvc::Policy
Policy
Definition: ExceptionSvc.h:57
ExceptionSvc::m_mode_exc_s
Gaudi::Property< std::string > m_mode_exc_s
Definition: ExceptionSvc.h:63
ExceptionSvc::FAILURE
@ FAILURE
Definition: ExceptionSvc.h:58
Gaudi::Property< std::string >
MsgStream.h
ExceptionSvc
Definition: ExceptionSvc.h:29