The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
ExceptionSvc.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2025 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#pragma once
12// ============================================================================
13// Include files
14// ============================================================================
15// GaudiKernel
16// ============================================================================
19#include <GaudiKernel/Service.h>
20// ============================================================================
27// ============================================================================
28class ExceptionSvc : public extends<Service, IExceptionSvc> {
29public:
31 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;
38public:
40 StatusCode initialize() override;
41
42public:
43 using extends::extends;
44
45private:
46 // default constructor is disabled
47 ExceptionSvc() = delete;
48 // copy constructor is disabled
49 ExceptionSvc( const ExceptionSvc& ) = delete;
50 // assignment operator is disabled
51 ExceptionSvc& operator=( const ExceptionSvc& ) = delete;
52 // process exceptions
53 virtual StatusCode process( const INamedInterface& o ) const;
54
55private:
56 enum Policy { ALL, NONE };
58
60 std::map<std::string, ReturnState> m_retCodesExc, m_retCodesErr;
61
63 Gaudi::Property<std::string> m_mode_err_s{ this, "Errors", "NONE" };
64};
65
66// ============================================================================
Policy m_mode_err
std::map< std::string, ReturnState > m_retCodesErr
Policy m_mode_exc
StatusCode handle(const INamedInterface &o, const GaudiException &e) const override
Handle caught GaudiExceptions.
StatusCode handleErr(const INamedInterface &o, const StatusCode &s) const override
Handle errors.
ExceptionSvc & operator=(const ExceptionSvc &)=delete
ExceptionSvc()=delete
no default constructor
Gaudi::Property< std::string > m_mode_exc_s
StatusCode initialize() override
initialize the service
Gaudi::Property< std::string > m_mode_err_s
std::map< std::string, ReturnState > m_retCodesExc
virtual StatusCode process(const INamedInterface &o) const
ExceptionSvc(const ExceptionSvc &)=delete
Implementation of property with value of concrete type.
Definition PropertyFwd.h:27
Define general base for Gaudi exception.
IInterface compliant class extending IInterface with the name() method.
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
Base class used to extend a class implementing other interfaces.
Definition extends.h:19