Gaudi Framework, version v21r7

Home   Generated: 22 Jan 2010

GslErrorHandlers.cpp

Go to the documentation of this file.
00001 // $Id: GslErrorHandlers.cpp,v 1.1 2003/11/19 16:55:59 mato Exp $
00002 // ============================================================================
00003 // 
00004 // ============================================================================
00005 // Include files
00006 // GaudiKernel
00007 #include "GaudiKernel/GaudiException.h"
00008 // GaudiGSL
00009 #include "GaudiGSL/IGslSvc.h"
00010 #include "GaudiGSL/GslError.h"
00011 // local
00012 #include "GaudiGSL/GslErrorHandlers.h"
00013 #include "GaudiGSL/GaudiGSL.h"
00014 
00024 void GslErrorHandlers::ignoreTheError 
00025 ( const char* /* reason */ , 
00026   const char* /* file   */ , 
00027   int         /* line   */ , 
00028   int         /* code   */ )
00029 {}
00030 
00031 void GslErrorHandlers::handleTheError 
00032 ( const char* reason , 
00033   const char* file   , 
00034   int         line   , 
00035   int         code   )
00036 {
00037   // het the GSL service 
00038   const IGslSvc* svc = GaudiGSL::gslSvc() ;
00039   // handle the error if service is valid 
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 // The END 
00064 // ============================================================================

Generated at Fri Jan 22 20:27:30 2010 for Gaudi Framework, version v21r7 by Doxygen version 1.5.6 written by Dimitri van Heesch, © 1997-2004