test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
rrapi.RRApiError Class Reference
Inheritance diagram for rrapi.RRApiError:
Exception

Public Member Functions

def __init__
 
def __str__
 

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 
15  def __init__(self, resp):
16  """
17  Construct exception by providing response object.
18  """
19  if type(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
def __init__
Definition: rrapi.py:14
double split
Definition: MVATrainer.cc:139

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, DQMNet::QValue.message, and ConfigBuilder.ConfigBuilder.message.

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

Member Data Documentation

rrapi.RRApiError.code

Definition at line 22 of file rrapi.py.

rrapi.RRApiError.message

Definition at line 19 of file rrapi.py.

Referenced by rrapi.RRApiError.__str__(), argparse.ArgumentError.__str__(), and python.rootplot.argparse.ArgumentError.__str__().

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().