0001 # The Python ISAPI package. 0002 0003 # Exceptions thrown by the DLL framework. 0004 class ISAPIError(Exception): 0005 def __init__(self, errno, strerror = None, funcname = None): 0006 # named attributes match IOError etc. 0007 self.errno = errno 0008 self.strerror = strerror 0009 self.funcname = funcname 0010 Exception.__init__(self, errno, strerror, funcname) 0011 def __str__(self): 0012 if self.strerror is None: 0013 try: 0014 import win32api 0015 self.strerror = win32api.FormatMessage(self.errno).strip() 0016 except: 0017 self.strerror = "no error message is available" 0018 # str() looks like a win32api error. 0019 return str( (self.errno, self.strerror, self.funcname) ) 0020 0021 class FilterError(ISAPIError): 0022 pass 0023 0024 class ExtensionError(ISAPIError): 0025 pass 0026 0027 # A little development aid - a filter or extension callback function can 0028 # raise one of these exceptions, and the handler module will be reloaded. 0029 # This means you can change your code without restarting IIS. 0030 # After a reload, your filter/extension will have the GetFilterVersion/ 0031 # GetExtensionVersion function called, but with None as the first arg. 0032 class InternalReloadException(Exception): 0033 pass 0034
Generated by PyXR 0.9.4