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 9 of file rrapi.py.

Constructor & Destructor Documentation

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

Definition at line 14 of file rrapi.py.

14  def __init__(self, resp):
15  """
16  Construct exception by providing response object.
17  """
18  if type(resp) == str:
19  self.message = resp
20  else:
21  self.url = resp.geturl()
22  self.code = resp.getcode()
23  self.stack = None
24  for line in resp.read().split("\n"):
25  if self.stack == None:
26  m = re.search("<pre>(.*)", line)
27  if m != None:
28  self.stack = m.group(1)
29  m = re.search("^.+\.([^\.]+: .*)$", self.stack)
30  if m != None:
31  self.message = m.group(1)
32  else:
33  self.message = line
34  else:
35  m = re.search("(.*)</pre>", line)
36  if m != None:
37  self.stack = self.stack + "\n" + m.group(1)
38  break
39  else:
40  self.stack = self.stack + "\n" + line
41 
double split
Definition: MVATrainer.cc:139
def __init__(self, resp)
Definition: rrapi.py:14

Member Function Documentation

def rrapi.RRApiError.__str__ (   self)
Get message 

Definition at line 42 of file rrapi.py.

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

42  def __str__(self):
43  """ Get message """
44  return self.message
45 
def __str__(self)
Definition: rrapi.py:42

Member Data Documentation

rrapi.RRApiError.code

Definition at line 22 of file rrapi.py.

rrapi.RRApiError.message
rrapi.RRApiError.stack

Definition at line 23 of file rrapi.py.

rrapi.RRApiError.url

Definition at line 21 of file rrapi.py.

Referenced by rrapi.RRApi.get().