GslErrorHandlers.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #include "GaudiKernel/GaudiException.h"
00008
00009 #include "GaudiGSL/IGslSvc.h"
00010 #include "GaudiGSL/GslError.h"
00011
00012 #include "GaudiGSL/GslErrorHandlers.h"
00013 #include "GaudiGSL/GaudiGSL.h"
00014
00024 void GslErrorHandlers::ignoreTheError
00025 ( const char* ,
00026 const char* ,
00027 int ,
00028 int )
00029 {}
00030
00031 void GslErrorHandlers::handleTheError
00032 ( const char* reason ,
00033 const char* file ,
00034 int line ,
00035 int code )
00036 {
00037
00038 const IGslSvc* svc = GaudiGSL::gslSvc() ;
00039
00040 if( 0 != svc ) { svc->handle( GslError( reason , file , line , code ) ) ; }
00041 }
00042
00043 void GslErrorHandlers::throwException
00044 ( const char* reason ,
00045 const char* file ,
00046 int line ,
00047 int code )
00048 {
00049 std::string error( " GSL ErrorCode=" );
00050 static char s_aux[512];
00051 error += std::string( s_aux , s_aux + sprintf( s_aux , "%d" , code ) );
00052 error += ": '" ;
00053 error += reason ;
00054 error += "' in the file '" ;
00055 error += file ;
00056 error += "' at the line " ;
00057 error += std::string( s_aux , s_aux + sprintf( s_aux , "%d" , line ) );
00058 error += "'" ;
00059 throw GaudiException( error , "*GLS Error*" , StatusCode::FAILURE );
00060 }
00061
00062
00063
00064