Anonymous committed fd1d6ec

- Return 404, not 500, when file not found in tip+ revision

Comments (0)

Files changed (2)

 # Specify a location to redirect to when the top-level index is requested.
 # If not specified, gives 404 NOT FOUND when top-level index is requested.
 # This is useful for browsing documentation locally.
-slipper.DEFAULT.index_path = dev/tip+/doc/
+slipper.DEFAULT.index_path = /dev/tip+/doc/
 # For each repository, choose a name, then specify both the location
 # of the repository on the local filesystem ('local_dir') and the base
         repo = localrepository(None, config.local_dir)
         if revision == 'tip+':
             ctx = repo.workingctx()
+            revision = 'tip'
             ctx = repo.changectx(revision)
             start_response(status, response_headers)
             return [status]
-        data =
+        try:
+            data =
+        except IOError:
+            # XXX: HTTP experts: is this correct?
+            status = '404 NOT FOUND'
+            response_headers = [
+                ('Content-Type', 'text/plain'),
+                ]
+            start_response(status, response_headers)
+            return [status]
         date = datestr(
         # XXX: HTTP experts: How do we short-circuit if the client's side is
         # up-to-date?
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.