Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 707

Show
Ignore:
Timestamp:
10/03/05 02:23:37
Author:
fumanchu
Message:

Fix for #307. Made InternalError? a subclass of HTTPError(500). Removed all use of InternalError? from the framework; it should be removed in 2.2.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/_cperror.py

    r684 r707  
    3030 
    3131class Error(Exception): 
    32     pass 
    33  
    34 class InternalError(Error): 
    35     """ Error that should never happen """ 
    3632    pass 
    3733 
     
    216212        self.args = (path,) 
    217213        HTTPError.__init__(self, 404, "The path %s was not found." % repr(path)) 
     214 
     215 
     216class InternalError(HTTPError): 
     217    """ Error that should never happen """ 
     218     
     219    def __init__(self, message=None): 
     220        HTTPError.__init__(self, 500, message) 
  • trunk/cherrypy/_cputil.py

    r694 r707  
    9090        return globals()[name] 
    9191    except KeyError: 
    92         raise cherrypy.InternalError("Special attribute %s could not be found" 
    93                                      % repr(name)
     92        msg = "Special attribute %s could not be found" % repr(name) 
     93        raise cherrypy.HTTPError(500, msg
    9494 
    9595def getSpecialAttributePath(name): 
     
    102102            if hasattr(objectList[i], name): 
    103103                return "/" + "/".join(pathList[:i] + [name]) 
    104     raise cherrypy.InternalError("Special attribute %s could not be found" 
    105                                  % repr(name)
     104    msg = "Special attribute %s could not be found" % repr(name) 
     105    raise cherrypy.HTTPError(500, msg
    106106 
    107107 

Hosted by WebFaction

Log in as guest/cpguest to create tickets