3 #include "GaudiKernel/MsgStream.h"
4 #include "GaudiKernel/System.h"
5 #include "GaudiKernel/ISvcLocator.h"
6 #include "GaudiKernel/IToolSvc.h"
11 #include "GaudiGSL/IGslErrorHandler.h"
12 #include "GaudiGSL/GslError.h"
14 #include "GaudiGSL/GaudiGSL.h"
16 #include "GaudiGSL/GslErrorHandlers.h"
18 #include "gsl/gsl_errno.h"
41 , m_errorPolicy ( "GSL" )
42 , m_handlersTypeNames ()
46 declareProperty(
"ErrorPolicy" , m_errorPolicy ) ;
47 declareProperty(
"Handlers" , m_handlersTypeNames ) ;
48 declareProperty(
"IgnoreCodes" , m_ignore ) ;
72 <<
" Error in initialization of base class 'Service'"<<
endmsg;
80 { gsl_set_error_handler_off() ; }
82 { gsl_set_error_handler ( 0 ) ; }
92 <<
" Valid policies: "
93 <<
"[ 'GSL' , 'Off' , 'Abort' , 'Ignore' , 'Exception' , 'Handle' ]"
100 gsl_set_error_handler( handler );
103 <<
" GSL Error Handler is '"
119 std::string::const_iterator ipos =
120 std::find( it->begin() , it->end() ,
'/');
121 const std::string::size_type pos = ipos - it->begin() ;
123 if( it->end() != ipos )
124 { sc = toolsvc->retrieveTool
125 ( std::string( *it , 0 , pos ) ,
126 std::string( *it , pos + 1, it->length() ), eh ,
this ) ; }
128 { sc = toolsvc->retrieveTool
129 ( *it , std::string( *it , pos + 1, it->length() ) ,
133 <<
" Could not retrieve tool '" << *it <<
"'"<<
endmsg ;
137 <<
" Could not retrieve tool '" << *it <<
"'"<<
endmsg ;
175 gsl_set_error_handler( hh );
189 gsl_set_error_handler( handler );
192 log <<
MSG::DEBUG <<
" New GSL handler is set '" ;
193 if( 0 == handler ) { log <<
"NULL" ; }
227 if( m_ignore.end() != std::find( m_ignore.begin () ,
229 error.
code ) ) {
return sc ; }
231 for( Handlers::const_iterator handler = m_handlers.begin() ;
232 sc.
isSuccess() && m_handlers.end() != handler ; ++handler )
233 { sc = (*handler)->handle( error ); }