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

Changeset 613

Show
Ignore:
Timestamp:
09/05/05 13:10:30
Author:
mikerobi
Message:

fixed HTTPStatusError, it did not except codes > 499

Files:

Legend:

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

    r608 r613  
    176176    """Exception raised when the client has made an error in its request.""" 
    177177     
    178     def __init__(self, status=400, message=None): 
     178    def __init__(self, status=400, message=_missing): 
    179179        self.status = status = int(status) 
    180         if status < 400 or status > 499: 
    181             raise ValueError("status must be between 400 and 499.") 
    182          
    183         # these 2 lines might dissapear 
     180        if status < 400 or status > 599: 
     181            raise ValueError("status must be between 400 and 599.") 
     182         
     183        # these 4 lines might dissapear 
    184184        import cherrypy 
    185185        cherrypy.response.status = status 
    186          
     186        if message is not _missing: 
     187            cherrypy.response.body=message 
     188 
    187189        self.message = message 
    188190     

Hosted by WebFaction

Log in as guest/cpguest to create tickets