| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

GslErrorException.cpp
Go to the documentation of this file.
1 // ============================================================================
2 // Include files
3 // from Gaudi
4 #include "GaudiKernel/GaudiException.h"
5 // STD & STL
6 #include <algorithm>
7 #include <string>
8 // local
9 #include "GslErrorException.h"
10
11 // ============================================================================
19 // ============================================================================
20
21 // ============================================================================
27 // ============================================================================
28 GslErrorException::GslErrorException
29 ( const std::string& type ,
30 const std::string& name ,
31 const IInterface* parent )
32 : base_class ( type, name , parent )
33 {
34 declareProperty ( "IgnoreCodes" , m_ignore );
35 }
36 // ============================================================================
37
38 // ============================================================================
39
40 // ============================================================================
47 // ============================================================================
48 StatusCode GslErrorException::handle
49 ( const GslError& error ) const
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 }
64 // ============================================================================
65
66 DECLARE_COMPONENT(GslErrorException)
67
68 // ============================================================================
69 // The END
70 // ============================================================================
GslError::reason
std::string reason
error message ('reason')
Definition: GslError.h:19
GslError::file
std::string file
file name
Definition: GslError.h:21
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
GslError
Helper class to represent GSL errors.
Definition: GslError.h:15
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
GslError::code
int code
error code (GSL)
Definition: GslError.h:25
std::to_string
T to_string(T...args)
GslError::line
int line
line number
Definition: GslError.h:23
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:36
std::string
STL class.
gaudirun.type
string type
Definition: gaudirun.py:151
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GaudiException.h
IInterface
Definition of the basic interface.
Definition: IInterface.h:234
GslErrorException::GslErrorException
GslErrorException(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition: GslErrorException.cpp:29
GslErrorException::handle
StatusCode handle(const GslError &error) const override
handle the GSL error
Definition: GslErrorException.cpp:49
std::find
T find(T...args)
GslErrorException.h
GslErrorException
Concrete GSL eror handler It is just thrown the exception.
Definition: GslErrorException.h:26
CommonMessaging
Definition: CommonMessaging.h:58