GslErrorException Class Reference

Concrete GSL eror handler It is just thrown the exception. More...

#include <src/Components/GslErrorException.h>

Inheritance diagram for GslErrorException:
Collaboration diagram for GslErrorException:

Public Member Functions

StatusCode handle (const GslError &error) const override
 handle the GSL error More...
 
 GslErrorException (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor. More...
 
 ~GslErrorException () override=default
 destructor (protected and virtual) More...
 
- Public Member Functions inherited from extends< BASE, Interfaces >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 ~extends () override=default
 Virtual destructor. More...
 
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 ~extends () override=default
 Virtual destructor. More...
 
- Public Member Functions inherited from extend_interfaces< Interfaces...>
 ~extend_interfaces () override=default
 Virtual destructor. More...
 
 ~extend_interfaces () override=default
 Virtual destructor. More...
 

Private Attributes

std::vector< int > m_ignore
 codes to be ignored: More...
 

Additional Inherited Members

- Public Types inherited from extends< BASE, Interfaces >
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
- Public Types inherited from extend_interfaces< Interfaces...>
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 

Detailed Description

Concrete GSL eror handler It is just thrown the exception.

Attention
The error handling could be "turned off" for selected error codes (e.g. GSL_SUCCESS or GSL_CONTINUE ) using "IgnoreCodes" property
Author
Vanya Belyaev Ivan..nosp@m.Bely.nosp@m.aev@i.nosp@m.tep..nosp@m.ru
Date
30/04/2002

Definition at line 26 of file GslErrorException.h.

Constructor & Destructor Documentation

GslErrorException::GslErrorException ( const std::string &  type,
const std::string &  name,
const IInterface parent 
)

Standard constructor.

Parameters
typetool type (?)
nametool name
parentpointer to parent

Definition at line 29 of file GslErrorException.cpp.

32  : base_class ( type, name , parent )
33 {
34  declareProperty ( "IgnoreCodes" , m_ignore );
35 }
std::vector< int > m_ignore
codes to be ignored:
extends base_class
Typedef to this class.
Definition: extends.h:14
string type
Definition: gaudirun.py:151
GslErrorException::~GslErrorException ( )
overridedefault

destructor (protected and virtual)

Member Function Documentation

StatusCode GslErrorException::handle ( const GslError error) const
override

handle the GSL error

See also
IGslErrorHandler
Parameters
errorerror to be handled
See also
GslError
Returns
status code

Definition at line 49 of file GslErrorException.cpp.

50 {
51  // throw if code is not in the list of codes to be ignored
52  if( m_ignore.end() == std::find( m_ignore.begin () ,
53  m_ignore.end () ,
54  error.code ) ) {
55  throw GaudiException( " GSL ErrorCode=" + std::to_string( error.code ) +
56  ": '" + error.reason +
57  "' in the file '" + error.file +
58  "' at line " + std::to_string(error.line)
59  , "*GLS Error*" , StatusCode::FAILURE );
60  }
62  return StatusCode::SUCCESS ;
63 }
std::string reason
error message ('reason')
Definition: GslError.h:19
string to_string(const T &value)
Definition: mergesort.cpp:40
std::vector< int > m_ignore
codes to be ignored:
std::string file
file name
Definition: GslError.h:21
Define general base for Gaudi exception.
int code
error code (GSL)
Definition: GslError.h:25
int line
line number
Definition: GslError.h:23

Member Data Documentation

std::vector<int> GslErrorException::m_ignore
private

codes to be ignored:

Definition at line 53 of file GslErrorException.h.


The documentation for this class was generated from the following files: