| 172 | | |
|---|
| 173 | | while True: |
|---|
| 174 | | try: |
|---|
| 175 | | page_handler, object_path, virtual_path = cherrypy.request.mapPathToObject(path) |
|---|
| 176 | | |
|---|
| 177 | | # Remove "root" from object_path and join it to get objectPath |
|---|
| 178 | | cherrypy.request.objectPath = '/' + '/'.join(object_path[1:]) |
|---|
| 179 | | args = virtual_path + cherrypy.request.paramList |
|---|
| 180 | | body = page_handler(*args, **cherrypy.request.paramMap) |
|---|
| 181 | | cherrypy.response.body = body |
|---|
| 182 | | return |
|---|
| 183 | | except cherrypy.InternalRedirect, x: |
|---|
| 184 | | # Try again with the new path |
|---|
| 185 | | path = x.path |
|---|
| | 172 | page_handler, object_path, virtual_path = cherrypy.request.mapPathToObject(path) |
|---|
| | 173 | |
|---|
| | 174 | # Remove "root" from object_path and join it to get objectPath |
|---|
| | 175 | cherrypy.request.objectPath = '/' + '/'.join(object_path[1:]) |
|---|
| | 176 | args = virtual_path + cherrypy.request.paramList |
|---|
| | 177 | body = page_handler(*args, **cherrypy.request.paramMap) |
|---|
| | 178 | cherrypy.response.body = body |
|---|
| | 212 | |
|---|
| | 213 | def afterErrorResponse(self): |
|---|
| | 214 | # The XML-RPC spec (http://www.xmlrpc.com/spec) says: |
|---|
| | 215 | # "Unless there's a lower-level error, always return 200 OK." |
|---|
| | 216 | # However if arrived here we do have a status set to 500 then |
|---|
| | 217 | # it means we got an error we didn't want to trap explicitely |
|---|
| | 218 | # so let's assume it's part of the "lower-level error" defined above. |
|---|
| | 219 | if cherrypy.response.status[:3] != '500': |
|---|
| | 220 | cherrypy.response.status = '200 OK' |
|---|