| The Gaudi Framework v29r1 (5cd95fa2)

- 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 // ============================================================================
28 // ============================================================================
29 StatusCode GslErrorException::handle( const GslError& error ) const
30 {
31 // throw if code is not in the list of codes to be ignored
32 if ( m_ignore.end() == std::find( m_ignore.begin(), m_ignore.end(), error.code ) ) {
33 throw GaudiException( " GSL ErrorCode=" + std::to_string( error.code ) + ": '" + error.reason + "' in the file '" +
34 error.file + "' at line " + std::to_string( error.line ),
35 "*GLS Error*", StatusCode::FAILURE );
36 }
38 return StatusCode::SUCCESS;
39 }
40 // ============================================================================
41
42 DECLARE_COMPONENT( GslErrorException )
43
44 // ============================================================================
45 // The END
46 // ============================================================================
GslError::reason
std::string reason
error message (&#39;reason&#39;)
Definition: GslError.h:20
StatusCode::SUCCESS
Definition: StatusCode.h:31
GslError::file
std::string file
file name
Definition: GslError.h:22
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:22
GslError
Helper class to represent GSL errors.
Definition: GslError.h:16
StatusCode::FAILURE
Definition: StatusCode.h:31
GslErrorException::handle
StatusCode handle(const GslError &error) const override
handle the GSL error
Definition: GslErrorException.cpp:29
GslError::code
int code
error code (GSL)
Definition: GslError.h:26
std::to_string
T to_string(T...args)
GslError::line
int line
line number
Definition: GslError.h:24
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:33
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
GaudiException.h
std::find
T find(T...args)
GslErrorException.h
GslErrorException
Concrete GSL eror handler It is just thrown the exception.
Definition: GslErrorException.h:26
GslErrorException::m_ignore
Gaudi::Property< std::vector< int > > m_ignore
Definition: GslErrorException.h:41