All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 ( const GslError& error ) const
31 {
32  // throw if code is not in the list of codes to be ignored
33  if( m_ignore.end() == std::find( m_ignore.begin () ,
34  m_ignore.end () ,
35  error.code ) ) {
36  throw GaudiException( " GSL ErrorCode=" + std::to_string( error.code ) +
37  ": '" + error.reason +
38  "' in the file '" + error.file +
39  "' at line " + std::to_string(error.line)
40  , "*GLS Error*" , StatusCode::FAILURE );
41  }
43  return StatusCode::SUCCESS ;
44 }
45 // ============================================================================
46 
48 
49 // ============================================================================
50 // The END
51 // ============================================================================
std::string reason
error message (&#39;reason&#39;)
Definition: GslError.h:19
std::string file
file name
Definition: GslError.h:21
Define general base for Gaudi exception.
Helper class to represent GSL errors.
Definition: GslError.h:15
StatusCode handle(const GslError &error) const override
handle the GSL error
int code
error code (GSL)
Definition: GslError.h:25
T to_string(T...args)
int line
line number
Definition: GslError.h:23
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:36
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
T find(T...args)
Concrete GSL eror handler It is just thrown the exception.