CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
rrapi.RRApiError Class Reference
Inheritance diagram for rrapi.RRApiError:
Exception

Public Member Functions

def __init__ (self, resp)
 
def __str__ (self)
 

Public Attributes

 code
 
 message
 
 stack
 
 url
 

Detailed Description

API Exception class

Definition at line 10 of file rrapi.py.

Constructor & Destructor Documentation

◆ __init__()

def rrapi.RRApiError.__init__ (   self,
  resp 
)
Construct exception by providing response object.

Definition at line 15 of file rrapi.py.

15  def __init__(self, resp):
16  """
17  Construct exception by providing response object.
18  """
19  if isinstance(resp, str):
20  self.message = resp
21  else:
22  self.url = resp.geturl()
23  self.code = resp.getcode()
24  self.stack = None
25  for line in resp.read().split("\n"):
26  if self.stack == None:
27  m = re.search("<pre>(.*)", line)
28  if m != None:
29  self.stack = m.group(1)
30  m = re.search("^.+\.([^\.]+: .*)$", self.stack)
31  if m != None:
32  self.message = m.group(1)
33  else:
34  self.message = line
35  else:
36  m = re.search("(.*)</pre>", line)
37  if m != None:
38  self.stack = self.stack + "\n" + m.group(1)
39  break
40  else:
41  self.stack = self.stack + "\n" + line
42 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ __str__()

def rrapi.RRApiError.__str__ (   self)
Get message 

Definition at line 43 of file rrapi.py.

References util.rrapi.RRApiError.message, rrapi.RRApiError.message, iniparser.ConfigData.message, cscdqm::Exception.message, and MonitorElementData::QReport::QValue.message.

43  def __str__(self):
44  """ Get message """
45  return self.message
46 

Member Data Documentation

◆ code

rrapi.RRApiError.code

Definition at line 23 of file rrapi.py.

◆ message

rrapi.RRApiError.message

Definition at line 20 of file rrapi.py.

Referenced by rrapi.RRApiError.__str__().

◆ stack

rrapi.RRApiError.stack

Definition at line 24 of file rrapi.py.

◆ url

rrapi.RRApiError.url

Definition at line 22 of file rrapi.py.

Referenced by rrapi.RRApi.get().