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

Changeset 1489

Show
Ignore:
Timestamp:
12/09/06 13:41:00
Author:
fumanchu
Message:

2.x backport of [1102] (better error messages on illegal response statuses).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cherrypy-2.x/cherrypy/lib/httptools.py

    r1015 r1489  
    288288        code = int(code) 
    289289    except ValueError: 
    290         raise ValueError("Illegal response status from server (non-numeric).") 
     290        raise ValueError("Illegal response status from server " 
     291                         "(%s is non-numeric)." % repr(code)) 
    291292     
    292293    if code < 100 or code > 599: 
    293         raise ValueError("Illegal response status from server (out of range).") 
     294        raise ValueError("Illegal response status from server " 
     295                         "(%s is out of range)." % repr(code)) 
    294296     
    295297    if code not in responseCodes: 
  • branches/cherrypy-2.x/cherrypy/test/test_core.py

    r1397 r1489  
    428428        self.getPage("/status/illegal") 
    429429        self.assertStatus(500) 
    430         msg = "Illegal response status from server (out of range)." 
     430        msg = "Illegal response status from server (781 is out of range)." 
    431431        self.assertErrorPage(500, msg) 
    432432         
     
    437437        self.getPage("/status/bad") 
    438438        self.assertStatus(500) 
    439         msg = "Illegal response status from server (non-numeric)." 
     439        msg = "Illegal response status from server ('error' is non-numeric)." 
    440440        self.assertErrorPage(500, msg) 
    441441     
     
    617617            # No traceback should be present 
    618618            self.getPage("/error/cause_err_in_finalize") 
    619             msg = "Illegal response status from server (non-numeric)." 
     619            msg = "Illegal response status from server ('ZOO' is non-numeric)." 
    620620            self.assertErrorPage(500, msg, None) 
    621621        finally: 

Hosted by WebFaction

Log in as guest/cpguest to create tickets