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

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 
std::vector< std::string_view > split(std::string_view, const char *)
def __init__(self, resp)
Definition: rrapi.py:15

Member Function Documentation

def rrapi.RRApiError.__str__ (   self)
Get message 

Definition at line 43 of file rrapi.py.

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

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

Member Data Documentation

rrapi.RRApiError.code

Definition at line 23 of file rrapi.py.

rrapi.RRApiError.message

Definition at line 20 of file rrapi.py.

Referenced by rrapi.RRApiError.__str__().

rrapi.RRApiError.stack

Definition at line 24 of file rrapi.py.

rrapi.RRApiError.url

Definition at line 22 of file rrapi.py.

Referenced by rrapi.RRApi.get().