Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
xpcom.Exception Class Reference
Inheritance diagram for xpcom.Exception:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def __str__

Public Attributes

 errno
 message

Detailed Description

Definition at line 58 of file __init__.py.


Constructor & Destructor Documentation

def xpcom.Exception.__init__ (   self,
  errno,
  message = None 
)

Definition at line 59 of file __init__.py.

00059 
00060     def __init__(self, errno, message = None):
00061         assert int(errno) == errno, "The errno param must be an integer"
00062         self.errno = errno
00063         self.message = message
        exceptions.Exception.__init__(self, errno)

Member Function Documentation

def xpcom.Exception.__str__ (   self)

Definition at line 64 of file __init__.py.

00064 
00065     def __str__(self):
00066         if not hr_map:
00067             import nsError
00068             for name, val in nsError.__dict__.items():
00069                 if type(val)==type(0):
00070                     hr_map[val] = name
00071         message = self.message
00072         if message is None:
00073             message = hr_map.get(self.errno)
00074             if message is None:
00075                 message = ""
00076         return "0x%x (%s)" % (self.errno, message)
00077 
00078 # An alias for Exception - allows code to say "from xpcom import COMException"
# rather than "Exception" - thereby preventing clashes.

Member Data Documentation

Definition at line 61 of file __init__.py.

Definition at line 62 of file __init__.py.


The documentation for this class was generated from the following file: