ATLAS Offline Software
Loading...
Searching...
No Matches
trferr.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3import os
4
5class TransformError( Exception ):
6 """Base class for PyJobTransform Exception classes"""
7 def __init__(self,message=None,error='TRF_UNKNOWN',**kwargs): # noqa: B042
8 Exception.__init__(self,error,message)
9 self.message = message
10 self.error = error
11 self.extras = kwargs
12
13 def __str__(self):
14 header = '%s: ' % self.error
15 msg = header + self.message
16 indent = os.linesep + ' '*len(header)
17 for n,v in self.extras.items():
18 msg += '%s%s=%s' % (indent,n,v)
19 return msg
20
21 def setError(self,error):
22 self.error = error
23 self.args = (self.error,self.message)
24
25 def setMessage(self,message):
26 self.message = message
27 self.args = (self.error,self.message)
28
29
31 """Exception raised in case of an error in the transform configuration"""
32 def __init__(self,message=None,error='TRF_CONFIG',**kwargs): # noqa: B042
33 TransformError.__init__(self,message,error,**kwargs)
34
35
37 """Exception raised in case a joboptions file can not be found"""
38 def __init__(self,filename,message=None,error='ATH_JOP_NOTFOUND'): # noqa: B042
39 mess = "JobOptions file %s not found" % filename
40 if message: mess += '. ' + message
41 TransformError.__init__(self,mess,error)
__init__(self, filename, message=None, error='ATH_JOP_NOTFOUND')
Definition trferr.py:38
__init__(self, message=None, error='TRF_CONFIG', **kwargs)
Definition trferr.py:32
setMessage(self, message)
Definition trferr.py:25
__init__(self, message=None, error='TRF_UNKNOWN', **kwargs)
Definition trferr.py:7