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

Changeset 619

Show
Ignore:
Timestamp:
09/09/05 08:15:15
Author:
rdelon
Message:

Leave TypeError? exceptions as they are

Files:

Legend:

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

    r616 r619  
    494494            # Remove "root" from object_path and join it to get objectPath 
    495495            cherrypy.request.objectPath = '/' + '/'.join(object_path[1:]) 
    496             try: 
    497                 args = virtual_path + cherrypy.request.paramList 
    498                 body = page_handler(*args, **cherrypy.request.paramMap) 
    499             except TypeError, x: 
    500                 m = re.match(r"(.*)\(\) got an unexpected keyword argument '(.*)'", x.args[0]) 
    501                 if m: 
    502                     fname, pname = m.groups() 
    503                     msg = ("The '%s' page handler received a '%s' parameter, " 
    504                            "which it does not handle." % (fname, pname)) 
    505                     raise TypeError(msg, repr(page_handler)) 
    506                 raise 
     496            args = virtual_path + cherrypy.request.paramList 
     497            body = page_handler(*args, **cherrypy.request.paramMap) 
    507498            cherrypy.response.body = iterable(body) 
    508499            return 
  • trunk/cherrypy/test/test_core.py

    r617 r619  
    315315        try: 
    316316            self.getPage("/params/?notathing=meeting") 
    317             self.assertInBody("The 'index' page handler received a 'notathing' " 
    318                               "parameter, which it does not handle.") 
     317            self.assertInBody("TypeError: index() got an unexpected keyword argument 'notathing'") 
    319318        finally: 
    320319            ignore.pop() 
  • trunk/docs/book/xml/sessions.xml

    r611 r619  
    126126    <section id="concurrent"> 
    127127        <title>Handling concurrent requests for the same session data</title> 
    128         <para>It is normally quite rare to have to simultaneous requests with the same session ID. It means that a same browser is making 2 requests to your server at the same time (to dynamic pages ... static pages don't have sessions). However, this case can happen (if you're using frames for instance), and it will happen more and more often as more and more people start using Ajax.</para> 
     128        <para>It is normally quite rare to have two simultaneous requests with the same session ID. It means that a same browser is making 2 requests to your server at the same time (to dynamic pages ... static data like images don't have sessions). However, this case can happen (if you're using frames for instance), and it will happen more and more often as more and more people start using Ajax.</para> 
    129129        <para>In that case, we need to make sure that access to the session data is serialized. This way threads can't both modify the data at the same time and leave it in an inconsistent state.</para> 
    130130        <para>By default, CherryPy will serialize access to the session data, so if a browser makes a second request while a first request is still being handled by the server, the second request will block while the first request is accessing the data. As soon as the first request is finished then the second request will be able to access it.</para> 

Hosted by WebFaction

Log in as guest/cpguest to create tickets