Skip to content
Snippets Groups Projects
Commit a8fe96f5 authored by Federico Stagni's avatar Federico Stagni
Browse files

treating separately lb-run errors from application errors

parent a7e4ae3c
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ from DIRAC.Core.Utilities.Subprocess import systemCall
__RCSID__ = "$Id$"
class LbRunError(RuntimeError):
""" Exception for command errors
""" Exception for lb-run errors
"""
pass
......@@ -107,7 +107,11 @@ class RunApplication(object):
if runResult['Value'][0]: # if exit status != 0
self.log.error( "lb-run or its application exited with status %d" % runResult['Value'][0] )
raise LHCbApplicationError( "%s %s exited with status %d" % ( self.applicationName, self.applicationVersion, runResult['Value'][0] ) )
if runResult['Value'][0] & 0x40: # this is an lb-run specific error, available from LbScripts v9r1p8
raise LbRunError( "Problem setting the environment: lb-run exited with status %d" % runResult['Value'][0] )
raise LHCbApplicationError( "%s %s exited with status %d" % ( self.applicationName,
self.applicationVersion,
runResult['Value'][0] ) )
self.log.info( "%s execution completed successfully" % self.applicationName )
......
......@@ -130,7 +130,10 @@ class ErrorLogging( ModuleBase ):
return S_OK()
except (LHCbApplicationError, LbRunError) as e: # This is the case for real application errors
except LbRunError as e: # This is the case for lb-run/environment errors
self.setApplicationStatus( repr(e) )
return S_ERROR( str(e) )
except LHCbApplicationError as e: # This is the case for real application errors
self.setApplicationStatus( repr(e) )
return S_ERROR( str(e) )
except Exception as e: #pylint:disable=broad-except
......
......@@ -183,7 +183,10 @@ class GaudiApplication( ModuleBase ):
return S_OK( "%s %s Successful" % ( self.applicationName, self.applicationVersion ) )
except (LHCbApplicationError, LbRunError) as e: # This is the case for real application errors
except LbRunError as e: # This is the case for lb-run/environment errors
self.setApplicationStatus( repr(e) )
return S_ERROR( str(e) )
except LHCbApplicationError as e: # This is the case for real application errors
self.setApplicationStatus( repr(e) )
return S_ERROR( str(e) )
except Exception as e: #pylint:disable=broad-except
......
......@@ -116,7 +116,10 @@ class GaudiApplicationScript( ModuleBase ):
self.setApplicationStatus( '%s Successful' % os.path.basename( self.script ) )
return S_OK( '%s Successful' % os.path.basename( self.script ) )
except (LHCbApplicationError, LbRunError) as e: # This is the case for real application errors
except LbRunError as e: # This is the case for lb-run/environment errors
self.setApplicationStatus( repr(e) )
return S_ERROR( str(e) )
except LHCbApplicationError as e: # This is the case for real application errors
self.setApplicationStatus( repr(e) )
return S_ERROR( str(e) )
except Exception as e: #pylint:disable=broad-except
......
......@@ -146,7 +146,10 @@ class RootApplication( ModuleBase ):
self.setApplicationStatus( '%s (Root) Successful' % self.applicationName )
return S_OK()
except (LHCbApplicationError, LbRunError) as e: # This is the case for real application errors
except LbRunError as e: # This is the case for lb-run/environment errors
self.setApplicationStatus( repr(e) )
return S_ERROR( str(e) )
except LHCbApplicationError as e: # This is the case for real application errors
self.setApplicationStatus( repr(e) )
return S_ERROR( str(e) )
except Exception as e: #pylint:disable=broad-except
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment