The Gaudi Framework  v29r0 (ff2e7097)
GslErrorException.cpp
Go to the documentation of this file.
1 // ============================================================================
2 // Include files
3 // from Gaudi
5 // STD & STL
6 #include <algorithm>
7 #include <string>
8 // local
9 #include "GslErrorException.h"
10 
11 // ============================================================================
19 // ============================================================================
20 
21 // ============================================================================
28 // ============================================================================
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 
43 
44 // ============================================================================
45 // The END
46 // ============================================================================
std::string reason
error message (&#39;reason&#39;)
Definition: GslError.h:20
std::string file
file name
Definition: GslError.h:22
Define general base for Gaudi exception.
Helper class to represent GSL errors.
Definition: GslError.h:16
StatusCode handle(const GslError &error) const override
handle the GSL error
int code
error code (GSL)
Definition: GslError.h:26
T to_string(T...args)
int line
line number
Definition: GslError.h:24
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:33
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
T find(T...args)
Concrete GSL eror handler It is just thrown the exception.
Gaudi::Property< std::vector< int > > m_ignore