| The Gaudi Framework v28r2p1 (f1a77ff4)

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

- File List
- File Members

GslErrorHandlers.cpp
Go to the documentation of this file.
1 // ============================================================================
2 // Include files
3 // GaudiKernel
4 #include "GaudiKernel/GaudiException.h"
5 // GaudiGSL
6 #include "GaudiGSL/IGslSvc.h"
7 #include "GaudiGSL/GslError.h"
8 // local
9 #include "GaudiGSL/GslErrorHandlers.h"
10 #include "GaudiGSL/GaudiGSL.h"
11
12 #include <sstream>
13
23 void GslErrorHandlers::ignoreTheError
24 ( const char* /* reason */ ,
25 const char* /* file */ ,
26 int /* line */ ,
27 int /* code */ )
28 {}
29
30 void GslErrorHandlers::handleTheError
31 ( const char* reason ,
32 const char* file ,
33 int line ,
34 int code )
35 {
36 // het the GSL service
37 const IGslSvc* svc = GaudiGSL::gslSvc() ;
38 // handle the error if service is valid
39 if( nullptr != svc ) { svc->handle( GslError( reason , file , line , code ) ) ; }
40 }
41
42 void GslErrorHandlers::throwException
43 ( const char* reason ,
44 const char* file ,
45 int line ,
46 int code )
47 {
48 std::ostringstream error;
49 error << " GSL ErrorCode=" << code << ": '" << reason
50 << "' in the file '" << file << "' at the line " << line;
51 throw GaudiException( error.str() , "*GLS Error*" , StatusCode::FAILURE );
52 }
53
54 // ============================================================================
55 // The END
56 // ============================================================================
GslErrorHandlers::handleTheError
GAUDI_API void handleTheError(const char *reason, const char *file, int line, int code)
The simplest Gsl Error handler, It delegates the actual error handling to GSL Service.
Definition: GslErrorHandlers.cpp:31
IGslSvc::handle
virtual StatusCode handle(const GslError &error) const =0
handle the GSL error
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
GslError
Helper class to represent GSL errors.
Definition: GslError.h:15
StatusCode::FAILURE
Definition: StatusCode.h:29
IGslSvc
The abstract interface to "deal" with GNU Scientific Library (GLS) The main task is the error handlin...
Definition: IGslSvc.h:16
GslErrorHandlers::throwException
GAUDI_API void throwException(const char *reason, const char *file, int line, int code)
The simple Gsl Error handler, it throwns the Gaudi Exception.
Definition: GslErrorHandlers.cpp:43
GslError.h
std::ostringstream
STL class.
GaudiException.h
std::ostringstream::str
T str(T...args)
GaudiGSL::gslSvc
static const IGslSvc * gslSvc()
static accessor to Gaudi GSL Service
Definition: GaudiGSL.cpp:27
IGslSvc.h
GslErrorHandlers::ignoreTheError
GAUDI_API void ignoreTheError(const char *reason, const char *file, int line, int code)
The simplest Gsl Error handler, It simply ingnores the error.
Definition: GslErrorHandlers.cpp:24
GslErrorHandlers.h
plotSpeedupsPyRoot.line
line
Definition: plotSpeedupsPyRoot.py:164
GaudiGSL.h